private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            //编辑
            //添加套餐
            try
            {
                string strGoodsId   = e.Item.Cells[0].Text;
                string strGoodsName = e.Item.Cells[1].Text;

                string         strGoodsPrice = ((TextBox)e.Item.Cells[3].Controls[0]).Text;
                string         strComments   = ((TextBox)e.Item.Cells[4].Controls[0]).Text;
                PackagesStruct ps            = new PackagesStruct();
                ps.strPackageId   = this.lblPackageId.Text;
                ps.strPackageName = this.lblPackageName.Text;
                ps.dPackagePrice  = Convert.ToDouble(this.lblPackagePrice.Text);

                ps.strGoodsId   = strGoodsId;
                ps.strGoodsName = strGoodsName;

                ps.dGoodsPrice = Convert.ToDouble(strGoodsPrice);
                ps.strComments = strComments;

                this.SetManager();
                m1.AddPackage(ps);
                //this.SetSuccMsgPageBydir("添加成功","paraconf/wfmPackages.aspx?vcPackageId="+this.txtPackageId.Text+"&vcPackageName="+this.txtPacakgeName.Text+"&nPackagePrice="+this.txtPackagePrice.Text);
                this.Popup("添加成功");
                Button1_Click(null, null);
            }
            catch (Exception ex)
            {
                this.clog.WriteLine(ex);
                this.SetErrorMsgPageBydirHistory(ex.Message);
                return;
            }
        }
Beispiel #2
0
 public void DeletePackage(PackagesStruct ps)
 {
     try
     {
         opa.DeletePackage(ps);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 public void AddPackage(PackagesStruct ps)
 {
     try
     {
         opa.AddPackage(ps);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private PackagesStruct getPackageStruct()
        {
            PackagesStruct ps = new PackagesStruct();

            ps.strPackageId   = this.txtPackageId.Text;
            ps.strPackageName = this.txtPacakgeName.Text;
            ps.dPackagePrice  = Convert.ToDouble(this.txtPackagePrice.Text);
            ps.strGoodsId     = this.txtGoodsId.Text;
            ps.strGoodsName   = this.txtGoodsName.Text;
            ps.dGoodsPrice    = Convert.ToDouble(this.txtGoodsPrice.Text);
            ps.strComments    = this.txtComments.Text;

            return(ps);
        }
 protected void Button3_Click(object sender, System.EventArgs e)
 {
     //删除套餐
     try
     {
         Validpage();
         PackagesStruct ps = this.getPackageStruct();
         this.SetManager();
         m1.DeletePackage(ps);
         this.SetSuccMsgPageBydir("删除成功", "paraconf/wfmPackages.aspx?vcPackageId=" + this.txtPackageId.Text + "&vcPackageName=" + this.txtPacakgeName.Text + "&nPackagePrice=" + this.txtPackagePrice.Text);
     }
     catch (Exception ex)
     {
         this.clog.WriteLine(ex);
         this.SetErrorMsgPageBydir(ex.Message);
         return;
     }
 }