Esempio n. 1
0
 /// <summary>
 /// 填写退货退款单
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gwmoney_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "select")
     {
         //隐藏列表
         this.panelsel.Visible = false;
         //隐藏查询条件
         this.panelselT.Visible = false;
         //退货扣款单
         this.plflag.Visible = true;
         GridViewRow gvrow         = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
         string      gvStoreNumber = gwmoney.Rows[gvrow.RowIndex].Cells[3].Text.Trim();
         string      gvDocID       = gwmoney.Rows[gvrow.RowIndex].Cells[4].Text.Trim();
         string      gvMoney       = (gwmoney.Rows[gvrow.RowIndex].FindControl("labmon") as Label).Text.Trim();
         ViewState["FID"]    = null;
         ViewState["Fdocid"] = null;
         this.labstore.Text  = gvStoreNumber;
         this.labcard.Text   = gvDocID;
         this.labmoney.Text  = gvMoney;
         this.TranControls(this.butInventoryDoc, new string[][] { new string[] { "000434", "确定" } });
         clear();
     }
     if (e.CommandName == "upmoney")
     {
         this.panelsel.Visible  = false;
         this.panelselT.Visible = false;
         this.plflag.Visible    = true;
         GridViewRow gvrow  = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
         int         ID     = int.Parse(((gwmoney.Rows[gvrow.RowIndex].FindControl("hdfddocid")) as HiddenField).Value.Trim());
         string      Fdocid = ((gwmoney.Rows[gvrow.RowIndex].FindControl("hdfEddoc")) as HiddenField).Value.Trim();
         ViewState["FID"]    = ID;
         ViewState["Fdocid"] = Fdocid;
         InventoryDocModel mondel = ReturnedGoodsMoneyBLL.GetInventory(ID, Fdocid);
         this.labstore.Text = mondel.Client.ToString();
         this.labcard.Text  = mondel.DocID.ToString();
         this.labmoney.Text = mondel.TotalMoney.ToString("f2");
         this.txtmoney.Text = mondel.Charged.ToString("f2");
         this.txtnote.Text  = mondel.Reason.ToString();
         this.TranControls(this.butInventoryDoc, new string[][] { new string[] { "000259", "修改" } });
     }
 }
Esempio n. 2
0
    /// <summary>
    /// 确定按钮
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void butInventoryDoc_Click(object sender, EventArgs e)
    {
        if (!ReturnedGoodsMoneyBLL.GetInventoryState(labcard.Text))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!") + "')</script>");
            return;
        }

        string  valida = string.Empty;
        double  money  = 0;
        string  note   = this.txtnote.Text.Trim();
        Boolean bol    = false;
        bool    b      = this.ValidateControl(out valida, out money, out note);

        if (b == false)
        {
            return;
        }
        if (ViewState["FID"] != null && ViewState["Fdocid"] != null)
        {
            //是否是添加
            bol = true;
        }
        if (ReturnedGoodsMoneyBLL.UPtInventoryDoc(labcard.Text, labstore.Text, 1, money, note, bol))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001401", "操作成功!") + "')</script>");
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!") + "')</script>");
        }
        this.plflag.Visible    = false;
        this.panelsel.Visible  = true;
        this.panelselT.Visible = true;
        butsele_Click(null, null);
    }
 /// <summary>
 /// 绑定数据
 /// </summary>
 /// <param name="id">ID</param>
 private void bind(string id)
 {
     this.gwdetails.DataSource = ReturnedGoodsMoneyBLL.GetInventoryDoctails(id);
     this.gwdetails.DataBind();
 }
 /// <summary>
 /// 获得币种
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public string getMoney(object obj)
 {
     return(ReturnedGoodsMoneyBLL.GetMoneyType(obj.ToString()));
 }
 /// <summary>
 /// 获取产品名称
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public string getName(object obj)
 {
     return(ReturnedGoodsMoneyBLL.GetProductName(obj.ToString().Trim()));
 }