protected override string AddData()
        {
            RDFNew.Module.Admin.Bas.Bas_Material obj = new RDFNew.Module.Admin.Bas.Bas_Material();
            DataTable dt = RDFNew.Module.DALHelper.GetMasterEmpty(null, "Bas_Material");
            DataRow dr;
            dr = dt.NewRow();
            dr["MaterialID"] = App_Com.Helper.InputText(this.txtMaterialID.Text, 500);
            dr["MaterialName"] = App_Com.Helper.InputText(this.txtMaterialName.Text, 500);
            dr["MaterialSpec"] = App_Com.Helper.InputText(this.txtMaterialSpec.Text, 500);
            dr["UnitID"] = App_Com.Helper.InputText(this.txtUnitID.Text, 500);
            dr["PricePur"] = App_Com.Helper.InputText(this.txtPricePur.Text, 500);
            dr["PriceCost"] = App_Com.Helper.InputText(this.txtPriceCost.Text, 500);
            dr["PriceSal"] = App_Com.Helper.InputText(this.txtPriceSal.Text, 500);
            dr["Enabled"] = this.ckbEnabled.Checked;
            dr["Remark"] = App_Com.Helper.InputText(this.txtRemark.Text, 500);

            dr["CrtBy"] = App_Com.Sys_User.GetUserInfo("UserID");
            dr["CrtOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt.Rows.Add(dr);
            object[] data = obj.ApplyMaster(dt.GetChanges(DataRowState.Added),
                                        App_Com.Helper.BuildLog("Bas_Material", "add"));
            if (data[0].ToString() != "0") //正常
                throw data[1] as Exception;
            else
                return data[1].ToString();
        }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Bas_Material";
     B_ModuleName = "物料";
     B_ToolBar1 = this.Toolbar1;
     B_IDAL = new RDFNew.Module.Admin.Bas.Bas_Material();
 }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Bas_Material";
     B_ModuleName = "物料";
     B_PageDetail = "Bas_Material.aspx";
     B_ToolBar1 = this.Toolbar1;
     B_Window1 = this.Window1;
     B_Grid1 = this.Grid1;
     B_IDAL = new RDFNew.Module.Admin.Bas.Bas_Material();
     B_TableKey = "Bas_Material.MaterialID";
     B_OrderBy = " Bas_Material.CrtOn Desc ";
 }
Exemple #4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            B_ModuleID = "Pur_PoM";
            B_ModuleName = "采购订单";
            B_ToolBar1 = this.Toolbar1;
            B_Grid1 = this.Grid1;
            B_IDAL = new RDFNew.Module.Admin.Bas.Bas_Material();
            B_TableKey = "Bas_Material.MaterialID";
            B_OrderBy = " Bas_Material.CrtOn Desc ";

            B_DetailSessionKey = "Pur_PoDAdd";
            B_ReturnEmpty = false;
        }
        protected override string UpdateData()
        {
            RDFNew.Module.Admin.Bas.Bas_Material obj = new RDFNew.Module.Admin.Bas.Bas_Material();
            object[] data = obj.GetMaster(B_Keyword);
            if (data[0].ToString() == "0") //正常
            {
                DataTable dt = data[1] as DataTable;
                if (dt.Rows.Count > 0)
                {
                    DataRow dr;
                    dr = dt.Rows[0];
                    dr["MaterialName"] = App_Com.Helper.InputText(this.txtMaterialName.Text, 500);
                    dr["MaterialSpec"] = App_Com.Helper.InputText(this.txtMaterialSpec.Text, 500);
                    dr["UnitID"] = App_Com.Helper.InputText(this.txtUnitID.Text, 500);
                    dr["PricePur"] = App_Com.Helper.InputText(this.txtPricePur.Text, 500);
                    dr["PriceCost"] = App_Com.Helper.InputText(this.txtPriceCost.Text, 500);
                    dr["PriceSal"] = App_Com.Helper.InputText(this.txtPriceSal.Text, 500);
                    dr["Enabled"] = this.ckbEnabled.Checked;
                    dr["Remark"] = App_Com.Helper.InputText(this.txtRemark.Text, 500);

                    dr["ModBy"] = App_Com.Sys_User.GetUserInfo("UserID");
                    dr["ModOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    data = obj.ApplyMaster(dt.GetChanges(DataRowState.Modified),
                                            App_Com.Helper.BuildLog("Bas_Material", "edit"));
                    if (data[0].ToString() != "0") //正常
                        throw data[1] as Exception;
                    else
                        return data[1].ToString();
                }
                else
                {
                    throw new Exception("需要修改的记录已不存在,请刷新后再试.");
                }
            }
            else
            {
                throw data[1] as Exception;
            }
        }