• repater列求和


    repater:

    sql里面求和

     

     1 public void showList()
     2         {
     3             string fromdate = txtFromDate.Text;
     4             string todate = txtToDate.Text;
     5             string sales = ddlSales.SelectedValue;
     6             DataTable dt = B_Commission.getSales_volume(fromdate,todate,sales);
     7             rptList_stk.DataSource =dt;
     8             rptList_stk.DataBind();
     9 
    10             if (dt != null && dt.Rows.Count > 0)
    11             {
    12                 foreach (DataRow dr in dt.Rows)
    13                 {
    14                     p_sub_total = p_sub_total + dr["amount"].getDbl();
    15                     P_sub_profit = P_sub_profit + dr["profit"].getDbl();
    16                 }
    17             }
    18 
    19             lbl_Total.Text = MyNumber.showNum_TwoDecimal(p_sub_total);
    20             lbl_Total_profit.Text = MyNumber.showNum_TwoDecimal(P_sub_profit);
    21         }

    if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
    {
    Model.MP_invoiceItem mp = ((Model.MP_invoiceItem)e.Item.DataItem);(使用model转化的时候)
    tal = tal + Convert.ToDecimal(mp.amount);
    }
    if (e.Item.ItemType == ListItemType.Footer)
    {
    Label lbl = (Label)e.Item.FindControl("lbl_Total");
    lbl.Text = tal.getString();
    }

    Model.MP_invoiceItem mp = ((Model.MP_invoiceItem)e.Item.DataItem);
    Label lbl = (Label)e.Item.FindControl("lbl_Total");
    lbl.Text = mp.amount.getString();
    tal = tal + Convert.ToDecimal(mp["amount"]);

    repeater增删改

     1 获得linkbutton的CommandArgument的值
     2 int spec_id = e.CommandArgument.getInt();
     3 
     4 if (e.CommandName == "Edit")
     5             {
     6                 textcommand = int.Parse(e.CommandArgument.ToString());
     7             }
     8             else if (e.CommandName == "Cancel")
     9             {
    10                 textcommand = -1;
    11             }
    12             else if (e.CommandName == "Update")
    13             {
    14                 //Update
    15                 int spec_id = e.CommandArgument.getInt();
    16                 string batch_code = ((TextBox)this.rptList.Items[e.Item.ItemIndex].FindControl("txtBatchCode")).Text.Trim();
    17                 string step_code = ((TextBox)this.rptList.Items[e.Item.ItemIndex].FindControl("txtStepCode")).Text.Trim();
    18                 int qty = ((TextBox)this.rptList.Items[e.Item.ItemIndex].FindControl("txtQty")).Text.Trim().getInt();
    19                 string warranty = ((TextBox)this.rptList.Items[e.Item.ItemIndex].FindControl("txtWarranty")).Text.Trim();
    20 
    21                 B_Item.updateItemSpac(batch_code, step_code, qty, warranty, spec_id);
    22                 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('更新ID:" +
    23                      e.CommandArgument + ";页面值:A," + batch_code + "----B," + step_code + "----C," + qty + "');", true);
    24                 AppendRowForUpdate();
    25             }
    26             else if (e.CommandName == "Delete")
    27             {
    28                 //Delete.  
    29                 for (int i = 0; i < rptList.Items.Count; i++)
    30                 {
    31                     CheckBox chk = (CheckBox)rptList.Items[i].FindControl("ckboxRemove");
    32                     if (chk.Checked)
    33                     {
    34                         int spec_id = e.CommandArgument.getInt();
    35                         B_Item.deleteItemSpac(spec_id);
    36                     }
    37                 }
    38                 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('删除ID:" + e.CommandArgument + "');", true);
    39                 AppendRowForUpdate();
    40             }
    41 
    42             ShowItemspec();
    43             AppendRowForUpdate();
    44         }
    45     }
    46 }
  • 相关阅读:
    helloc
    传Intel镁光合资公司重启新加坡闪存芯片厂投产计划 月产能可达10万片
    关于c++ cout输出顺序问题。
    记录一次迁移Apollo Server V3的过程
    从springfox迁移到springdoc
    angular和spring boot的standalone部署
    随便总结几条委托和事件的知识点
    TCP连接的建立与断开
    开博第一天
    使用HTTP协议时判断客户端是否“在线”?
  • 原文地址:https://www.cnblogs.com/suan1717/p/6378178.html
Copyright © 2020-2023  润新知