Beispiel #1
0
    /// <summary>
    /// 数据保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LCustData model = new LCustData();
        LCustBB custBB = new LCustBB();
        try
        {
            if (this.State == "1")
            {
                this.SetModel(ref model);
                model.isrtDt = DateTime.Now.ToString();
                model.isrtEmpId = this.currentUser.empId;
                this.IdValue = custBB.AddRecord(model);
            }
            else if (this.State == "2")
            {
                model = custBB.GetModel(this.IdValue);
                this.SetModel(ref model);
                model.updtDt = DateTime.Now.ToString();
                model.updtEmpId = this.currentUser.empId;
                custBB.ModifyRecord(model);
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            custBB.Dispose();
        }

        Response.Redirect("LCustList.aspx?&itemno=" + this.itemNo + "&pTypeNo=main", false);
    }
 /// <summary>
 /// 展示数据
 /// </summary>
 /// <param name="id">记录Id</param>
 private void ShowInfo(int id)
 {
     LCustBB custBB = new LCustBB();
     LCustData model = new LCustData();
     try
     {
         model = custBB.GetModel(id);
         this.custNo.Text = model.custNo;
         this.custNm.Text = model.custNm;
         this.custSort.Text = model.custSort;
         this.shippingMark.Text = model.shippingMark;
         this.TradTerm.Text = model.TradTerm;
         this.BLReleTerm.Text = model.BLReleTerm;
         this.traySort.Text = model.traySort;
         this.area.Text = model.area;
         this.receiveAddress.Text = model.receiveAddress;
         this.factAddress.Text = model.factAddress;
         this.requestBill.Text = model.requestBill;
     }
     finally
     {
         custBB.Dispose();
     }
 }