public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCOMPANY_CODE.Text.Trim().Length == 0) { strErr += "COMPANY_CODE不能为空!\\n"; } if (this.txtCOMPANY_NAME.Text.Trim().Length == 0) { strErr += "COMPANY_NAME不能为空!\\n"; } if (this.txtPARENT_COMPANY_CODE.Text.Trim().Length == 0) { strErr += "PARENT_COMPANY_CODE不能为空!\\n"; } if (this.txtCUSTOM_CODE.Text.Trim().Length == 0) { strErr += "CUSTOM_CODE不能为空!\\n"; } if (this.txtCUSTOM_NAME.Text.Trim().Length == 0) { strErr += "CUSTOM_NAME不能为空!\\n"; } if (this.txtBillTYPE.Text.Trim().Length == 0) { strErr += "BillTYPE不能为空!\\n"; } if (this.txtSTOCK_CODE.Text.Trim().Length == 0) { strErr += "STOCK_CODE不能为空!\\n"; } if (this.txtSTOCK_NAME.Text.Trim().Length == 0) { strErr += "STOCK_NAME不能为空!\\n"; } if (this.txtINSTOCK_CODE.Text.Trim().Length == 0) { strErr += "INSTOCK_CODE不能为空!\\n"; } if (this.txtINSTOCK_NAME.Text.Trim().Length == 0) { strErr += "INSTOCK_NAME不能为空!\\n"; } if (this.txtEMPLOYEE_CODE.Text.Trim().Length == 0) { strErr += "EMPLOYEE_CODE不能为空!\\n"; } if (this.txtEMPLOYEE_NAME.Text.Trim().Length == 0) { strErr += "EMPLOYEE_NAME不能为空!\\n"; } if (!PageValidate.IsDateTime(txtBillDate.Text)) { strErr += "BillDate格式错误!\\n"; } if (this.txtBILL_STATUS.Text.Trim().Length == 0) { strErr += "BILL_STATUS不能为空!\\n"; } if (!PageValidate.IsDecimal(txtPayAcount.Text)) { strErr += "PayAcount格式错误!\\n"; } if (this.txtREMARK.Text.Trim().Length == 0) { strErr += "REMARK不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string BillNO = this.lblBillNO.Text; string COMPANY_CODE = this.txtCOMPANY_CODE.Text; string COMPANY_NAME = this.txtCOMPANY_NAME.Text; string PARENT_COMPANY_CODE = this.txtPARENT_COMPANY_CODE.Text; string CUSTOM_CODE = this.txtCUSTOM_CODE.Text; string CUSTOM_NAME = this.txtCUSTOM_NAME.Text; string BillTYPE = this.txtBillTYPE.Text; string STOCK_CODE = this.txtSTOCK_CODE.Text; string STOCK_NAME = this.txtSTOCK_NAME.Text; string INSTOCK_CODE = this.txtINSTOCK_CODE.Text; string INSTOCK_NAME = this.txtINSTOCK_NAME.Text; string EMPLOYEE_CODE = this.txtEMPLOYEE_CODE.Text; string EMPLOYEE_NAME = this.txtEMPLOYEE_NAME.Text; DateTime BillDate = DateTime.Parse(this.txtBillDate.Text); string BILL_STATUS = this.txtBILL_STATUS.Text; decimal PayAcount = decimal.Parse(this.txtPayAcount.Text); string REMARK = this.txtREMARK.Text; MyERP.Model.SAL_RECEIPT_MASTER model = new MyERP.Model.SAL_RECEIPT_MASTER(); model.BillNO = BillNO; model.COMPANY_CODE = COMPANY_CODE; model.COMPANY_NAME = COMPANY_NAME; model.PARENT_COMPANY_CODE = PARENT_COMPANY_CODE; model.CUSTOM_CODE = CUSTOM_CODE; model.CUSTOM_NAME = CUSTOM_NAME; model.BillTYPE = BillTYPE; model.STOCK_CODE = STOCK_CODE; model.STOCK_NAME = STOCK_NAME; model.INSTOCK_CODE = INSTOCK_CODE; model.INSTOCK_NAME = INSTOCK_NAME; model.EMPLOYEE_CODE = EMPLOYEE_CODE; model.EMPLOYEE_NAME = EMPLOYEE_NAME; model.BillDate = BillDate; model.BILL_STATUS = BILL_STATUS; model.PayAcount = PayAcount; model.REMARK = REMARK; MyERP.BLL.SAL_RECEIPT_MASTER bll = new MyERP.BLL.SAL_RECEIPT_MASTER(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtStatCode.Text.Trim().Length == 0) { strErr += "StatCode不能为空!\\n"; } if (!PageValidate.IsDecimal(txtTP.Text)) { strErr += "TP格式错误!\\n"; } if (!PageValidate.IsDecimal(txtDB.Text)) { strErr += "DB格式错误!\\n"; } if (!PageValidate.IsDateTime(txtDatatime.Text)) { strErr += "Datatime格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWindSpeed.Text)) { strErr += "WindSpeed格式错误!\\n"; } if (!PageValidate.IsDecimal(txtRain.Text)) { strErr += "Rain格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWindDirection.Text)) { strErr += "WindDirection格式错误!\\n"; } if (!PageValidate.IsDecimal(txtTemperature.Text)) { strErr += "Temperature格式错误!\\n"; } if (!PageValidate.IsDecimal(txtHumidity.Text)) { strErr += "Humidity格式错误!\\n"; } if (!PageValidate.IsDecimal(txtAirpressure.Text)) { strErr += "Airpressure格式错误!\\n"; } if (this.txtDataStatus.Text.Trim().Length == 0) { strErr += "DataStatus不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string StatCode = this.txtStatCode.Text; decimal TP = decimal.Parse(this.txtTP.Text); decimal DB = decimal.Parse(this.txtDB.Text); DateTime Datatime = DateTime.Parse(this.txtDatatime.Text); decimal WindSpeed = decimal.Parse(this.txtWindSpeed.Text); decimal Rain = decimal.Parse(this.txtRain.Text); decimal WindDirection = decimal.Parse(this.txtWindDirection.Text); decimal Temperature = decimal.Parse(this.txtTemperature.Text); decimal Humidity = decimal.Parse(this.txtHumidity.Text); decimal Airpressure = decimal.Parse(this.txtAirpressure.Text); string DataStatus = this.txtDataStatus.Text; ESMonitor.Model.ESMin model = new ESMonitor.Model.ESMin(); model.StatCode = StatCode; model.TP = TP; model.DB = DB; model.Datatime = Datatime; model.WindSpeed = WindSpeed; model.Rain = Rain; model.WindDirection = WindDirection; model.Temperature = Temperature; model.Humidity = Humidity; model.Airpressure = Airpressure; model.DataStatus = DataStatus; ESMonitor.BLL.ESMin bll = new ESMonitor.BLL.ESMin(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
/// <summary> /// 删除一条数据 /// </summary> public bool DeleteList(string PIDlist) { return(dal.DeleteList(PageValidate.SafeLongFilter(PIDlist, 0))); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtcom_name.Text.Trim().Length == 0) { strErr += "商品名不能为空!\\n"; } if (!PageValidate.IsDateTime(txtcom_productDate.Text)) { strErr += "生产日期格式错误!\\n"; } if (!PageValidate.IsNumber(txtcom_number.Text)) { strErr += "商品数量格式错误!\\n"; } if (this.txtcom_strageID.Text.Trim().Length == 0) { strErr += "货架号不能为空!\\n"; } if (!PageValidate.IsNumber(txtcom_alertNumber.Text)) { strErr += "警戒值格式错误!\\n"; } if (!PageValidate.IsNumber(txtcom_pic_ID.Text)) { strErr += "图片格式错误!\\n"; } if (!PageValidate.IsNumber(txtcom_pri_ID.Text)) { strErr += "二级类别格式错误!\\n"; } if (!PageValidate.IsNumber(txtcom_conversionInt.Text)) { strErr += "积分格式错误!\\n"; } if (!PageValidate.IsNumber(txtcom_comc_ID.Text)) { strErr += "类别格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string com_name = this.txtcom_name.Text; DateTime com_productDate = DateTime.Parse(this.txtcom_productDate.Text); int com_number = int.Parse(this.txtcom_number.Text); string com_strageID = this.txtcom_strageID.Text; int com_alertNumber = int.Parse(this.txtcom_alertNumber.Text); int com_pic_ID = int.Parse(this.txtcom_pic_ID.Text); DateTime com_date = DateTime.Parse(this.txtcom_date.Text); int com_pri_ID = int.Parse(this.txtcom_pri_ID.Text); int com_conversionInt = int.Parse(this.txtcom_conversionInt.Text); int com_comc_ID = int.Parse(this.txtcom_comc_ID.Text); string com_valid = this.txtcom_valid.Text; WalleProject.Model.t_commodity model = new WalleProject.Model.t_commodity(); model.com_name = com_name; model.com_productDate = com_productDate; model.com_number = com_number; model.com_strageID = com_strageID; model.com_alertNumber = com_alertNumber; model.com_pic_ID = com_pic_ID; model.com_date = com_date; model.com_pri_ID = com_pri_ID; model.com_conversionInt = com_conversionInt; model.com_comc_ID = com_comc_ID; model.com_valid = com_valid; WalleProject.BLL.t_commodity bll = new WalleProject.BLL.t_commodity(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtMeterID.Text)) { strErr += "MeterID格式错误!\\n"; } if (this.txtFreezeDate.Text.Trim().Length == 0) { strErr += "FreezeDate不能为空!\\n"; } if (!PageValidate.IsDecimal(txtUseNumber.Text)) { strErr += "UseNumber格式错误!\\n"; } if (!PageValidate.IsNumber(txtDosageType.Text)) { strErr += "DosageType格式错误!\\n"; } if (!PageValidate.IsDateTime(txtInsertDate.Text)) { strErr += "InsertDate格式错误!\\n"; } if (this.txtBeginDate.Text.Trim().Length == 0) { strErr += "BeginDate不能为空!\\n"; } if (!PageValidate.IsDecimal(txtBeginNumber.Text)) { strErr += "BeginNumber格式错误!\\n"; } if (!PageValidate.IsDecimal(txtEndNumber.Text)) { strErr += "EndNumber格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int id = int.Parse(this.lblid.Text); int MeterID = int.Parse(this.txtMeterID.Text); string FreezeDate = this.txtFreezeDate.Text; decimal UseNumber = decimal.Parse(this.txtUseNumber.Text); int DosageType = int.Parse(this.txtDosageType.Text); DateTime InsertDate = DateTime.Parse(this.txtInsertDate.Text); string BeginDate = this.txtBeginDate.Text; decimal BeginNumber = decimal.Parse(this.txtBeginNumber.Text); decimal EndNumber = decimal.Parse(this.txtEndNumber.Text); WebDemo.Model.WebDemo.FreezeDayDosage model = new WebDemo.Model.WebDemo.FreezeDayDosage(); model.id = id; model.MeterID = MeterID; model.FreezeDate = FreezeDate; model.UseNumber = UseNumber; model.DosageType = DosageType; model.InsertDate = InsertDate; model.BeginDate = BeginDate; model.BeginNumber = BeginNumber; model.EndNumber = EndNumber; WebDemo.BLL.WebDemo.FreezeDayDosage bll = new WebDemo.BLL.WebDemo.FreezeDayDosage(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtu_address.Text.Trim().Length == 0) { strErr += "u_address不能为空!\\n"; } if (!PageValidate.IsDateTime(txtu_lastLoginDate.Text)) { strErr += "u_lastLoginDate格式错误!\\n"; } if (!PageValidate.IsNumber(txtu_creaditsLogID.Text)) { strErr += "u_creaditsLogID格式错误!\\n"; } if (!PageValidate.IsDateTime(txtu_registrationDate.Text)) { strErr += "u_registrationDate格式错误!\\n"; } if (this.txtu_nickName.Text.Trim().Length == 0) { strErr += "u_nickName不能为空!\\n"; } if (this.txtu_category.Text.Trim().Length == 0) { strErr += "u_category不能为空!\\n"; } if (!PageValidate.IsDateTime(txtu_birthDate.Text)) { strErr += "u_birthDate格式错误!\\n"; } if (this.txtu_state.Text.Trim().Length == 0) { strErr += "u_state不能为空!\\n"; } if (this.txtu_passWord.Text.Trim().Length == 0) { strErr += "u_passWord不能为空!\\n"; } if (!PageValidate.IsNumber(txtu_integral.Text)) { strErr += "u_integral格式错误!\\n"; } if (this.txtu_creditGrade.Text.Trim().Length == 0) { strErr += "u_creditGrade不能为空!\\n"; } if (this.txtu_name.Text.Trim().Length == 0) { strErr += "u_name不能为空!\\n"; } if (!PageValidate.IsNumber(txtu_pic_ID.Text)) { strErr += "u_pic_ID格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string u_address = this.txtu_address.Text; DateTime u_lastLoginDate = DateTime.Parse(this.txtu_lastLoginDate.Text); int u_creaditsLogID = int.Parse(this.txtu_creaditsLogID.Text); DateTime u_registrationDate = DateTime.Parse(this.txtu_registrationDate.Text); string u_nickName = this.txtu_nickName.Text; string u_category = this.txtu_category.Text; DateTime u_birthDate = DateTime.Parse(this.txtu_birthDate.Text); string u_state = this.txtu_state.Text; string u_passWord = this.txtu_passWord.Text; int u_integral = int.Parse(this.txtu_integral.Text); string u_creditGrade = this.txtu_creditGrade.Text; string u_name = this.txtu_name.Text; int u_pic_ID = int.Parse(this.txtu_pic_ID.Text); WalleProject.Model.t_user model = new WalleProject.Model.t_user(); model.u_address = u_address; model.u_lastLoginDate = u_lastLoginDate; model.u_creaditsLogID = u_creaditsLogID; model.u_registrationDate = u_registrationDate; model.u_nickName = u_nickName; model.u_category = u_category; model.u_birthDate = u_birthDate; model.u_state = u_state; model.u_passWord = u_passWord; model.u_integral = u_integral; model.u_creditGrade = u_creditGrade; model.u_name = u_name; model.u_pic_ID = u_pic_ID; WalleProject.BLL.t_user bll = new WalleProject.BLL.t_user(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtId.Text)) { strErr += "Id格式错误!\\n"; } if (this.txtCustomerCode.Text.Trim().Length == 0) { strErr += "CustomerCode不能为空!\\n"; } if (this.txtCustomerName.Text.Trim().Length == 0) { strErr += "CustomerName不能为空!\\n"; } if (this.txtCustomerShortName.Text.Trim().Length == 0) { strErr += "CustomerShortName不能为空!\\n"; } if (this.txtCustomerPhone.Text.Trim().Length == 0) { strErr += "CustomerPhone不能为空!\\n"; } if (this.txtCustomerWebchat.Text.Trim().Length == 0) { strErr += "CustomerWebchat不能为空!\\n"; } if (this.txtEnterpriseName.Text.Trim().Length == 0) { strErr += "EnterpriseName不能为空!\\n"; } if (this.txtEnterpriseLegal.Text.Trim().Length == 0) { strErr += "EnterpriseLegal不能为空!\\n"; } if (this.txtEnterpriseAddress.Text.Trim().Length == 0) { strErr += "EnterpriseAddress不能为空!\\n"; } if (this.txtEnterprisePhone.Text.Trim().Length == 0) { strErr += "EnterprisePhone不能为空!\\n"; } if (!PageValidate.IsDateTime(txtDateTimeCreated.Text)) { strErr += "DateTimeCreated格式错误!\\n"; } if (this.txtUserCreator.Text.Trim().Length == 0) { strErr += "UserCreator不能为空!\\n"; } if (!PageValidate.IsDateTime(txtDateTimeModified.Text)) { strErr += "DateTimeModified格式错误!\\n"; } if (this.txtUserModified.Text.Trim().Length == 0) { strErr += "UserModified不能为空!\\n"; } if (this.txtOrgId.Text.Trim().Length == 0) { strErr += "OrgId不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.txtId.Text); string CustomerCode = this.txtCustomerCode.Text; string CustomerName = this.txtCustomerName.Text; string CustomerShortName = this.txtCustomerShortName.Text; string CustomerPhone = this.txtCustomerPhone.Text; string CustomerWebchat = this.txtCustomerWebchat.Text; string EnterpriseName = this.txtEnterpriseName.Text; string EnterpriseLegal = this.txtEnterpriseLegal.Text; string EnterpriseAddress = this.txtEnterpriseAddress.Text; string EnterprisePhone = this.txtEnterprisePhone.Text; DateTime DateTimeCreated = DateTime.Parse(this.txtDateTimeCreated.Text); string UserCreator = this.txtUserCreator.Text; DateTime DateTimeModified = DateTime.Parse(this.txtDateTimeModified.Text); string UserModified = this.txtUserModified.Text; bool State = this.chkState.Checked; string OrgId = this.txtOrgId.Text; Bsam.Core.Model.Models.Model.Sfc_Customer model = new Bsam.Core.Model.Models.Model.Sfc_Customer(); model.Id = Id; model.CustomerCode = CustomerCode; model.CustomerName = CustomerName; model.CustomerShortName = CustomerShortName; model.CustomerPhone = CustomerPhone; model.CustomerWebchat = CustomerWebchat; model.EnterpriseName = EnterpriseName; model.EnterpriseLegal = EnterpriseLegal; model.EnterpriseAddress = EnterpriseAddress; model.EnterprisePhone = EnterprisePhone; model.DateTimeCreated = DateTimeCreated; model.UserCreator = UserCreator; model.DateTimeModified = DateTimeModified; model.UserModified = UserModified; model.State = State; model.OrgId = OrgId; Bsam.Core.Model.Models.BLL.Sfc_Customer bll = new Bsam.Core.Model.Models.BLL.Sfc_Customer(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtcpmc.Text.Trim().Length == 0) { strErr += "cpmc不能为空!\\n"; } if (!PageValidate.IsNumber(txtcs.Text)) { strErr += "cs格式错误!\\n"; } if (!PageValidate.IsNumber(txtssdw.Text)) { strErr += "ssdw格式错误!\\n"; } if (!PageValidate.IsNumber(txtkfdw.Text)) { strErr += "kfdw格式错误!\\n"; } if (!PageValidate.IsNumber(txtdc.Text)) { strErr += "dc格式错误!\\n"; } if (!PageValidate.IsNumber(txtdj.Text)) { strErr += "dj格式错误!\\n"; } if (!PageValidate.IsNumber(txtje.Text)) { strErr += "je格式错误!\\n"; } if (this.txtbz.Text.Trim().Length == 0) { strErr += "bz不能为空!\\n"; } if (this.txtgydw.Text.Trim().Length == 0) { strErr += "gydw不能为空!\\n"; } if (this.txtjsr.Text.Trim().Length == 0) { strErr += "jsr不能为空!\\n"; } if (!PageValidate.IsDateTime(txtsj.Text)) { strErr += "sj格式错误!\\n"; } if (this.txtddbh.Text.Trim().Length == 0) { strErr += "ddbh不能为空!\\n"; } if (this.txtdjbh.Text.Trim().Length == 0) { strErr += "djbh不能为空!\\n"; } if (this.txtskfs.Text.Trim().Length == 0) { strErr += "skfs不能为空!\\n"; } if (!PageValidate.IsNumber(txtfkjine.Text)) { strErr += "fkjine格式错误!\\n"; } if (!PageValidate.IsNumber(txtyue.Text)) { strErr += "yue格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int id = int.Parse(this.lblid.Text); string cpmc = this.txtcpmc.Text; int cs = int.Parse(this.txtcs.Text); int ssdw = int.Parse(this.txtssdw.Text); int kfdw = int.Parse(this.txtkfdw.Text); int dc = int.Parse(this.txtdc.Text); int dj = int.Parse(this.txtdj.Text); int je = int.Parse(this.txtje.Text); string bz = this.txtbz.Text; string gydw = this.txtgydw.Text; string jsr = this.txtjsr.Text; DateTime sj = DateTime.Parse(this.txtsj.Text); string ddbh = this.txtddbh.Text; string djbh = this.txtdjbh.Text; string skfs = this.txtskfs.Text; int fkjine = int.Parse(this.txtfkjine.Text); int yue = int.Parse(this.txtyue.Text); Maticsoft.Model.cccc.nep model = new Maticsoft.Model.cccc.nep(); model.id = id; model.cpmc = cpmc; model.cs = cs; model.ssdw = ssdw; model.kfdw = kfdw; model.dc = dc; model.dj = dj; model.je = je; model.bz = bz; model.gydw = gydw; model.jsr = jsr; model.sj = sj; model.ddbh = ddbh; model.djbh = djbh; model.skfs = skfs; model.fkjine = fkjine; model.yue = yue; Maticsoft.BLL.cccc.nep bll = new Maticsoft.BLL.cccc.nep(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtMeterID.Text)) { strErr += "MeterID格式错误!\\n"; } if (this.txtFreezeDate.Text.Trim().Length == 0) { strErr += "FreezeDate不能为空!\\n"; } if (!PageValidate.IsDecimal(txtFreezeNumber.Text)) { strErr += "FreezeNumber格式错误!\\n"; } if (!PageValidate.IsDateTime(txtReadDate.Text)) { strErr += "ReadDate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtInstantNumber.Text)) { strErr += "InstantNumber格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPileNumber.Text)) { strErr += "PileNumber格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWatertemp.Text)) { strErr += "Watertemp格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBackWatertemp.Text)) { strErr += "BackWatertemp格式错误!\\n"; } if (!PageValidate.IsNumber(txtWorkDate.Text)) { strErr += "WorkDate格式错误!\\n"; } if (this.txtFactDate.Text.Trim().Length == 0) { strErr += "FactDate不能为空!\\n"; } if (!PageValidate.IsNumber(txtBatteryState.Text)) { strErr += "BatteryState格式错误!\\n"; } if (!PageValidate.IsNumber(txtWarning.Text)) { strErr += "Warning格式错误!\\n"; } if (!PageValidate.IsNumber(txtValveState.Text)) { strErr += "ValveState格式错误!\\n"; } if (!PageValidate.IsDecimal(txtOldFreezeNumber.Text)) { strErr += "OldFreezeNumber格式错误!\\n"; } if (!PageValidate.IsNumber(txtMegabit.Text)) { strErr += "Megabit格式错误!\\n"; } if (!PageValidate.IsNumber(txtPriceSetNo.Text)) { strErr += "PriceSetNo格式错误!\\n"; } if (!PageValidate.IsDateTime(txtCollectorReadDate.Text)) { strErr += "CollectorReadDate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtRemnant.Text)) { strErr += "Remnant格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int MeterID = int.Parse(this.txtMeterID.Text); string FreezeDate = this.txtFreezeDate.Text; decimal FreezeNumber = decimal.Parse(this.txtFreezeNumber.Text); DateTime ReadDate = DateTime.Parse(this.txtReadDate.Text); decimal InstantNumber = decimal.Parse(this.txtInstantNumber.Text); decimal PileNumber = decimal.Parse(this.txtPileNumber.Text); decimal Watertemp = decimal.Parse(this.txtWatertemp.Text); decimal BackWatertemp = decimal.Parse(this.txtBackWatertemp.Text); int WorkDate = int.Parse(this.txtWorkDate.Text); string FactDate = this.txtFactDate.Text; int BatteryState = int.Parse(this.txtBatteryState.Text); int Warning = int.Parse(this.txtWarning.Text); int ValveState = int.Parse(this.txtValveState.Text); decimal OldFreezeNumber = decimal.Parse(this.txtOldFreezeNumber.Text); int Megabit = int.Parse(this.txtMegabit.Text); int PriceSetNo = int.Parse(this.txtPriceSetNo.Text); DateTime CollectorReadDate = DateTime.Parse(this.txtCollectorReadDate.Text); decimal Remnant = decimal.Parse(this.txtRemnant.Text); WebDemo.Model.WebDemo.FreezeDayLog model = new WebDemo.Model.WebDemo.FreezeDayLog(); model.MeterID = MeterID; model.FreezeDate = FreezeDate; model.FreezeNumber = FreezeNumber; model.ReadDate = ReadDate; model.InstantNumber = InstantNumber; model.PileNumber = PileNumber; model.Watertemp = Watertemp; model.BackWatertemp = BackWatertemp; model.WorkDate = WorkDate; model.FactDate = FactDate; model.BatteryState = BatteryState; model.Warning = Warning; model.ValveState = ValveState; model.OldFreezeNumber = OldFreezeNumber; model.Megabit = Megabit; model.PriceSetNo = PriceSetNo; model.CollectorReadDate = CollectorReadDate; model.Remnant = Remnant; WebDemo.BLL.WebDemo.FreezeDayLog bll = new WebDemo.BLL.WebDemo.FreezeDayLog(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtPriceTypeName.Text.Trim().Length == 0) { strErr += "价格名称不能为空!\\n"; } if (!PageValidate.IsNumber(txtMeterTypeID.Text)) { strErr += "表类型编号格式错误!\\n"; } if (!PageValidate.IsNumber(txtPriceNo.Text)) { strErr += "程序控制格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice.Text)) { strErr += "单价格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice2.Text)) { strErr += "单价2格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice3.Text)) { strErr += "单价3格式错误!\\n"; } if (!PageValidate.IsNumber(txtDivid1.Text)) { strErr += "分界点1格式错误!\\n"; } if (!PageValidate.IsNumber(txtDivid2.Text)) { strErr += "分界点2格式错误!\\n"; } if (this.txtPriceUnit.Text.Trim().Length == 0) { strErr += "PriceUnit不能为空!\\n"; } if (this.txtRemark.Text.Trim().Length == 0) { strErr += "备注信息不能为空!\\n"; } if (!PageValidate.IsDecimal(txtPrice4.Text)) { strErr += "Price4格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice5.Text)) { strErr += "Price5格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice6.Text)) { strErr += "Price6格式错误!\\n"; } if (!PageValidate.IsNumber(txtDivid3.Text)) { strErr += "Divid3格式错误!\\n"; } if (!PageValidate.IsNumber(txtDivid4.Text)) { strErr += "Divid4格式错误!\\n"; } if (!PageValidate.IsNumber(txtDivid5.Text)) { strErr += "Divid5格式错误!\\n"; } if (!PageValidate.IsDateTime(txtExeDate.Text)) { strErr += "ExeDate格式错误!\\n"; } if (!PageValidate.IsNumber(txtSetNo.Text)) { strErr += "SetNo格式错误!\\n"; } if (!PageValidate.IsNumber(txtSuiteNo.Text)) { strErr += "SuiteNo格式错误!\\n"; } if (!PageValidate.IsNumber(txtGroupPriceNo.Text)) { strErr += "GroupPriceNo格式错误!\\n"; } if (this.txtPriceTypeCode.Text.Trim().Length == 0) { strErr += "PriceTypeCode不能为空!\\n"; } if (!PageValidate.IsNumber(txtIsStartStar.Text)) { strErr += "IsStartStar格式错误!\\n"; } if (!PageValidate.IsNumber(txtIsStartPeople.Text)) { strErr += "IsStartPeople格式错误!\\n"; } if (!PageValidate.IsNumber(txtPeopleCheck.Text)) { strErr += "PeopleCheck格式错误!\\n"; } if (!PageValidate.IsNumber(txtMaxPeople.Text)) { strErr += "MaxPeople格式错误!\\n"; } if (!PageValidate.IsDecimal(txtAddUseNumber.Text)) { strErr += "AddUseNumber格式错误!\\n"; } if (!PageValidate.IsNumber(txtStarsLevel.Text)) { strErr += "StarsLevel格式错误!\\n"; } if (!PageValidate.IsNumber(txtStarsPeriod.Text)) { strErr += "StarsPeriod格式错误!\\n"; } if (!PageValidate.IsNumber(txtStarsCorrected.Text)) { strErr += "StarsCorrected格式错误!\\n"; } if (!PageValidate.IsNumber(txtIsStartArea.Text)) { strErr += "IsStartArea格式错误!\\n"; } if (!PageValidate.IsDecimal(txtCoefficient.Text)) { strErr += "Coefficient格式错误!\\n"; } if (!PageValidate.IsNumber(txtCalculateDay.Text)) { strErr += "CalculateDay格式错误!\\n"; } if (!PageValidate.IsNumber(txtStarsAreaWay.Text)) { strErr += "StarsAreaWay格式错误!\\n"; } if (!PageValidate.IsNumber(txtStarsByUser.Text)) { strErr += "StarsByUser格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string PriceTypeName = this.txtPriceTypeName.Text; int MeterTypeID = int.Parse(this.txtMeterTypeID.Text); int PriceNo = int.Parse(this.txtPriceNo.Text); decimal Price = decimal.Parse(this.txtPrice.Text); decimal Price2 = decimal.Parse(this.txtPrice2.Text); decimal Price3 = decimal.Parse(this.txtPrice3.Text); int Divid1 = int.Parse(this.txtDivid1.Text); int Divid2 = int.Parse(this.txtDivid2.Text); string PriceUnit = this.txtPriceUnit.Text; string Remark = this.txtRemark.Text; decimal Price4 = decimal.Parse(this.txtPrice4.Text); decimal Price5 = decimal.Parse(this.txtPrice5.Text); decimal Price6 = decimal.Parse(this.txtPrice6.Text); int Divid3 = int.Parse(this.txtDivid3.Text); int Divid4 = int.Parse(this.txtDivid4.Text); int Divid5 = int.Parse(this.txtDivid5.Text); DateTime ExeDate = DateTime.Parse(this.txtExeDate.Text); int SetNo = int.Parse(this.txtSetNo.Text); int SuiteNo = int.Parse(this.txtSuiteNo.Text); int GroupPriceNo = int.Parse(this.txtGroupPriceNo.Text); string PriceTypeCode = this.txtPriceTypeCode.Text; int IsStartStar = int.Parse(this.txtIsStartStar.Text); int IsStartPeople = int.Parse(this.txtIsStartPeople.Text); int PeopleCheck = int.Parse(this.txtPeopleCheck.Text); int MaxPeople = int.Parse(this.txtMaxPeople.Text); decimal AddUseNumber = decimal.Parse(this.txtAddUseNumber.Text); int StarsLevel = int.Parse(this.txtStarsLevel.Text); int StarsPeriod = int.Parse(this.txtStarsPeriod.Text); int StarsCorrected = int.Parse(this.txtStarsCorrected.Text); int IsStartArea = int.Parse(this.txtIsStartArea.Text); decimal Coefficient = decimal.Parse(this.txtCoefficient.Text); int CalculateDay = int.Parse(this.txtCalculateDay.Text); int StarsAreaWay = int.Parse(this.txtStarsAreaWay.Text); int StarsByUser = int.Parse(this.txtStarsByUser.Text); WebDemo.Model.WebDemo.PriceType model = new WebDemo.Model.WebDemo.PriceType(); model.PriceTypeName = PriceTypeName; model.MeterTypeID = MeterTypeID; model.PriceNo = PriceNo; model.Price = Price; model.Price2 = Price2; model.Price3 = Price3; model.Divid1 = Divid1; model.Divid2 = Divid2; model.PriceUnit = PriceUnit; model.Remark = Remark; model.Price4 = Price4; model.Price5 = Price5; model.Price6 = Price6; model.Divid3 = Divid3; model.Divid4 = Divid4; model.Divid5 = Divid5; model.ExeDate = ExeDate; model.SetNo = SetNo; model.SuiteNo = SuiteNo; model.GroupPriceNo = GroupPriceNo; model.PriceTypeCode = PriceTypeCode; model.IsStartStar = IsStartStar; model.IsStartPeople = IsStartPeople; model.PeopleCheck = PeopleCheck; model.MaxPeople = MaxPeople; model.AddUseNumber = AddUseNumber; model.StarsLevel = StarsLevel; model.StarsPeriod = StarsPeriod; model.StarsCorrected = StarsCorrected; model.IsStartArea = IsStartArea; model.Coefficient = Coefficient; model.CalculateDay = CalculateDay; model.StarsAreaWay = StarsAreaWay; model.StarsByUser = StarsByUser; WebDemo.BLL.WebDemo.PriceType bll = new WebDemo.BLL.WebDemo.PriceType(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtMeterID.Text)) { strErr += "MeterID格式错误!\\n"; } if (this.txtFreezeMonth.Text.Trim().Length == 0) { strErr += "FreezeMonth不能为空!\\n"; } if (!PageValidate.IsDecimal(txtFreezeNumber.Text)) { strErr += "FreezeNumber格式错误!\\n"; } if (!PageValidate.IsDateTime(txtReadDate.Text)) { strErr += "ReadDate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtInstantNumber.Text)) { strErr += "InstantNumber格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPileNumber.Text)) { strErr += "PileNumber格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWatertemp.Text)) { strErr += "Watertemp格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBackWatertemp.Text)) { strErr += "BackWatertemp格式错误!\\n"; } if (!PageValidate.IsNumber(txtWorkDate.Text)) { strErr += "WorkDate格式错误!\\n"; } if (this.txtFactDate.Text.Trim().Length == 0) { strErr += "FactDate不能为空!\\n"; } if (!PageValidate.IsNumber(txtBatteryState.Text)) { strErr += "BatteryState格式错误!\\n"; } if (!PageValidate.IsNumber(txtWarning.Text)) { strErr += "Warning格式错误!\\n"; } if (!PageValidate.IsNumber(txtReadType.Text)) { strErr += "ReadType格式错误!\\n"; } if (!PageValidate.IsDecimal(txtOldFreezeNumber.Text)) { strErr += "OldFreezeNumber格式错误!\\n"; } if (!PageValidate.IsNumber(txtMegabit.Text)) { strErr += "Megabit格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int MeterID = int.Parse(this.txtMeterID.Text); string FreezeMonth = this.txtFreezeMonth.Text; decimal FreezeNumber = decimal.Parse(this.txtFreezeNumber.Text); DateTime ReadDate = DateTime.Parse(this.txtReadDate.Text); bool CalMark = this.chkCalMark.Checked; decimal InstantNumber = decimal.Parse(this.txtInstantNumber.Text); decimal PileNumber = decimal.Parse(this.txtPileNumber.Text); decimal Watertemp = decimal.Parse(this.txtWatertemp.Text); decimal BackWatertemp = decimal.Parse(this.txtBackWatertemp.Text); int WorkDate = int.Parse(this.txtWorkDate.Text); string FactDate = this.txtFactDate.Text; int BatteryState = int.Parse(this.txtBatteryState.Text); int Warning = int.Parse(this.txtWarning.Text); int ReadType = int.Parse(this.txtReadType.Text); decimal OldFreezeNumber = decimal.Parse(this.txtOldFreezeNumber.Text); int Megabit = int.Parse(this.txtMegabit.Text); WebDemo.Model.WebDemo.FreezeMonthls model = new WebDemo.Model.WebDemo.FreezeMonthls(); model.MeterID = MeterID; model.FreezeMonth = FreezeMonth; model.FreezeNumber = FreezeNumber; model.ReadDate = ReadDate; model.CalMark = CalMark; model.InstantNumber = InstantNumber; model.PileNumber = PileNumber; model.Watertemp = Watertemp; model.BackWatertemp = BackWatertemp; model.WorkDate = WorkDate; model.FactDate = FactDate; model.BatteryState = BatteryState; model.Warning = Warning; model.ReadType = ReadType; model.OldFreezeNumber = OldFreezeNumber; model.Megabit = Megabit; WebDemo.BLL.WebDemo.FreezeMonthls bll = new WebDemo.BLL.WebDemo.FreezeMonthls(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; HttpRequest request = context.Request; BLL.public_notice notice = new BLL.public_notice(); Model.public_notice model = new Model.public_notice(); var cookie = context.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string CoockiesID = ticket.UserData; BLL.hr_employee emp = new BLL.hr_employee(); int emp_id = int.Parse(CoockiesID); DataSet dsemp = emp.GetList("id=" + emp_id); string empname = dsemp.Tables[0].Rows[0]["name"].ToString(); string uid = dsemp.Tables[0].Rows[0]["uid"].ToString(); if (request["Action"] == "save") { DataRow dremp = dsemp.Tables[0].Rows[0]; model.notice_time = DateTime.Now; model.notice_title = PageValidate.InputText(request["T_title"], 255); model.notice_content = PageValidate.InputText(request["T_content"], int.MaxValue); string nid = PageValidate.InputText(request["nid"], 50); if (!string.IsNullOrEmpty(nid) && nid != "null") { if (!Common.PageValidate.IsNumber(nid)) { nid = "-1"; } DataSet ds = notice.GetList("id=" + int.Parse(nid)); DataRow dr = ds.Tables[0].Rows[0]; model.dep_id = int.Parse(dr["dep_id"].ToString()); model.dep_name = dr["dep_name"].ToString(); model.create_id = int.Parse(dr["create_id"].ToString()); model.create_name = dr["create_name"].ToString(); model.id = int.Parse(nid); notice.Update(model); C_Sys_log log = new C_Sys_log(); int UserID = emp_id; string UserName = empname; string IPStreet = request.UserHostAddress; string EventTitle = model.notice_title; string EventType = "公告修改"; int EventID = model.id; if (dr["notice_title"].ToString() != request["T_title"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "公告标题", dr["notice_title"].ToString(), request["T_title"]); } if (dr["notice_content"].ToString() != request["T_content"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "公告内容", "原内容被修改", "原内容被修改"); } } else { int depid = int.Parse(dremp["d_id"].ToString()); string depname = dremp["dname"].ToString(); model.dep_id = depid; model.dep_name = depname; model.create_id = emp_id; model.create_name = empname; notice.Add(model); } } if (request["Action"] == "grid") { int PageIndex = int.Parse(request["page"] == null ? "1" : request["page"]); int PageSize = int.Parse(request["pagesize"] == null ? "30" : request["pagesize"]); string sortname = request["sortname"]; string sortorder = request["sortorder"]; if (string.IsNullOrEmpty(sortname)) { sortname = " notice_time"; } if (string.IsNullOrEmpty(sortorder)) { sortorder = "desc"; } string sorttext = " " + sortname + " " + sortorder; string Total; string serchtxt = " 1=1 "; if (!string.IsNullOrEmpty(request["sstart"])) { serchtxt += " and notice_time >= '" + PageValidate.InputText(request["sstart"], 50) + "'"; } if (!string.IsNullOrEmpty(request["sdend"])) { DateTime enddate = DateTime.Parse(request["sdend"]).AddHours(23).AddMinutes(59).AddSeconds(59); serchtxt += " and notice_time <= '" + enddate + "'"; } if (!string.IsNullOrEmpty(request["stext"])) { if (request["stext"] != "输入关键词搜索") { serchtxt += " and notice_title like N'%" + PageValidate.InputText(request["stext"], 500) + "%'"; } } DataSet ds = notice.GetList(PageSize, PageIndex, serchtxt, sorttext, out Total); context.Response.Write(Common.GetGridJSON.DataTableToJSON1(ds.Tables[0], Total)); } if (request["Action"] == "form") { string nid = PageValidate.InputText(request["nid"], 50); DataSet ds = notice.GetList("id=" + int.Parse(nid)); string dt = Common.DataToJson.DataToJSON(ds); context.Response.Write(dt); } //del if (request["Action"] == "del") { bool canDel = false; if (dsemp.Tables[0].Rows.Count > 0) { if (dsemp.Tables[0].Rows[0]["uid"].ToString() == "admin") { canDel = true; } else { Data.GetAuthorityByUid getauth = new Data.GetAuthorityByUid(); string delauth = getauth.GetBtnAuthority(emp_id.ToString(), "13"); if (delauth == "false") { canDel = false; } else { canDel = true; } } } if (canDel) { int id = int.Parse(request["id"]); DataSet ds = notice.GetList("id=" + id); string EventType = "彻底删除公告"; bool isdel = notice.Delete(id); if (isdel) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int UserID = emp_id; string UserName = empname; string IPStreet = request.UserHostAddress; int EventID = id; string EventTitle = ds.Tables[0].Rows[i]["notice_title"].ToString(); string Original_txt = null; string Current_txt = null; C_Sys_log log = new C_Sys_log(); log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, null, Original_txt, Current_txt); } context.Response.Write("true"); } else { context.Response.Write("false"); } } else { context.Response.Write("auth"); } } if (request["Action"] == "noticeremind") { DataSet ds = notice.GetList(7, "", " notice_time desc"); string dt = Common.GetGridJSON.DataTableToJSON(ds.Tables[0]); context.Response.Write(dt); } }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtSEQUENCE.Text)) { strErr += "SEQUENCE格式错误!\\n"; } if (this.txtITEM_INTERNAL_CODE.Text.Trim().Length == 0) { strErr += "ITEM_INTERNAL_CODE不能为空!\\n"; } if (this.txtITEM_CODE.Text.Trim().Length == 0) { strErr += "ITEM_CODE不能为空!\\n"; } if (this.txtITEM_CODE_old.Text.Trim().Length == 0) { strErr += "ITEM_CODE_old不能为空!\\n"; } if (this.txtITEM_NAME.Text.Trim().Length == 0) { strErr += "ITEM_NAME不能为空!\\n"; } if (this.txtITEM_COLOR.Text.Trim().Length == 0) { strErr += "ITEM_COLOR不能为空!\\n"; } if (this.txtPARENT_ITEM_CODE.Text.Trim().Length == 0) { strErr += "PARENT_ITEM_CODE不能为空!\\n"; } if (this.txtITEM_TYPE.Text.Trim().Length == 0) { strErr += "ITEM_TYPE不能为空!\\n"; } if (this.txtSPECIFICATIONS.Text.Trim().Length == 0) { strErr += "SPECIFICATIONS不能为空!\\n"; } if (this.txtMEASURE_UNIT.Text.Trim().Length == 0) { strErr += "MEASURE_UNIT不能为空!\\n"; } if (this.txtDESCRIPTION.Text.Trim().Length == 0) { strErr += "DESCRIPTION不能为空!\\n"; } if (!PageValidate.IsDecimal(txtITEM_LH.Text)) { strErr += "ITEM_LH格式错误!\\n"; } if (!PageValidate.IsDecimal(txtITEM_LK.Text)) { strErr += "ITEM_LK格式错误!\\n"; } if (!PageValidate.IsDecimal(txtITEM_BJ.Text)) { strErr += "ITEM_BJ格式错误!\\n"; } if (!PageValidate.IsDecimal(txtITEM_JZ.Text)) { strErr += "ITEM_JZ格式错误!\\n"; } if (!PageValidate.IsDecimal(txtITEM_HZ.Text)) { strErr += "ITEM_HZ格式错误!\\n"; } if (this.txtITEM_rate.Text.Trim().Length == 0) { strErr += "ITEM_rate不能为空!\\n"; } if (this.txtITEM_GYLC.Text.Trim().Length == 0) { strErr += "ITEM_GYLC不能为空!\\n"; } if (!PageValidate.IsDecimal(txtNET_PRICE.Text)) { strErr += "NET_PRICE格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPRICE.Text)) { strErr += "PRICE格式错误!\\n"; } if (!PageValidate.IsDecimal(txtQuantity.Text)) { strErr += "Quantity格式错误!\\n"; } if (this.txtBARCODE.Text.Trim().Length == 0) { strErr += "BARCODE不能为空!\\n"; } if (this.txtCREATE_NAME.Text.Trim().Length == 0) { strErr += "CREATE_NAME不能为空!\\n"; } if (!PageValidate.IsDateTime(txtCREATE_DATE.Text)) { strErr += "CREATE_DATE格式错误!\\n"; } if (this.txtUPDATE_NAME.Text.Trim().Length == 0) { strErr += "UPDATE_NAME不能为空!\\n"; } if (!PageValidate.IsDateTime(txtUPDATE_DATE.Text)) { strErr += "UPDATE_DATE格式错误!\\n"; } if (this.txtREMARK.Text.Trim().Length == 0) { strErr += "REMARK不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int SEQUENCE = int.Parse(this.txtSEQUENCE.Text); string ITEM_INTERNAL_CODE = this.txtITEM_INTERNAL_CODE.Text; string ITEM_CODE = this.txtITEM_CODE.Text; string ITEM_CODE_old = this.txtITEM_CODE_old.Text; string ITEM_NAME = this.txtITEM_NAME.Text; string ITEM_COLOR = this.txtITEM_COLOR.Text; string PARENT_ITEM_CODE = this.txtPARENT_ITEM_CODE.Text; string ITEM_TYPE = this.txtITEM_TYPE.Text; string SPECIFICATIONS = this.txtSPECIFICATIONS.Text; string MEASURE_UNIT = this.txtMEASURE_UNIT.Text; string DESCRIPTION = this.txtDESCRIPTION.Text; decimal ITEM_LH = decimal.Parse(this.txtITEM_LH.Text); decimal ITEM_LK = decimal.Parse(this.txtITEM_LK.Text); decimal ITEM_BJ = decimal.Parse(this.txtITEM_BJ.Text); decimal ITEM_JZ = decimal.Parse(this.txtITEM_JZ.Text); decimal ITEM_HZ = decimal.Parse(this.txtITEM_HZ.Text); string ITEM_rate = this.txtITEM_rate.Text; string ITEM_GYLC = this.txtITEM_GYLC.Text; decimal NET_PRICE = decimal.Parse(this.txtNET_PRICE.Text); decimal PRICE = decimal.Parse(this.txtPRICE.Text); decimal Quantity = decimal.Parse(this.txtQuantity.Text); string BARCODE = this.txtBARCODE.Text; string CREATE_NAME = this.txtCREATE_NAME.Text; DateTime CREATE_DATE = DateTime.Parse(this.txtCREATE_DATE.Text); string UPDATE_NAME = this.txtUPDATE_NAME.Text; DateTime UPDATE_DATE = DateTime.Parse(this.txtUPDATE_DATE.Text); string REMARK = this.txtREMARK.Text; MyERP.Model.PUB_ITEM_DETAIL model = new MyERP.Model.PUB_ITEM_DETAIL(); model.SEQUENCE = SEQUENCE; model.ITEM_INTERNAL_CODE = ITEM_INTERNAL_CODE; model.ITEM_CODE = ITEM_CODE; model.ITEM_CODE_old = ITEM_CODE_old; model.ITEM_NAME = ITEM_NAME; model.ITEM_COLOR = ITEM_COLOR; model.PARENT_ITEM_CODE = PARENT_ITEM_CODE; model.ITEM_TYPE = ITEM_TYPE; model.SPECIFICATIONS = SPECIFICATIONS; model.MEASURE_UNIT = MEASURE_UNIT; model.DESCRIPTION = DESCRIPTION; model.ITEM_LH = ITEM_LH; model.ITEM_LK = ITEM_LK; model.ITEM_BJ = ITEM_BJ; model.ITEM_JZ = ITEM_JZ; model.ITEM_HZ = ITEM_HZ; model.ITEM_rate = ITEM_rate; model.ITEM_GYLC = ITEM_GYLC; model.NET_PRICE = NET_PRICE; model.PRICE = PRICE; model.Quantity = Quantity; model.BARCODE = BARCODE; model.CREATE_NAME = CREATE_NAME; model.CREATE_DATE = CREATE_DATE; model.UPDATE_NAME = UPDATE_NAME; model.UPDATE_DATE = UPDATE_DATE; model.REMARK = REMARK; MyERP.BLL.PUB_ITEM_DETAIL bll = new MyERP.BLL.PUB_ITEM_DETAIL(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtname.Text.Trim().Length == 0) { strErr += "name不能为空!\\n"; } if (this.txtbeizhu.Text.Trim().Length == 0) { strErr += "beizhu不能为空!\\n"; } if (!PageValidate.IsDecimal(txtBy1.Text)) { strErr += "By1格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBy2.Text)) { strErr += "By2格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBy3.Text)) { strErr += "By3格式错误!\\n"; } if (this.txtBy4.Text.Trim().Length == 0) { strErr += "By4不能为空!\\n"; } if (this.txtBy5.Text.Trim().Length == 0) { strErr += "By5不能为空!\\n"; } if (this.txtBy6.Text.Trim().Length == 0) { strErr += "By6不能为空!\\n"; } if (this.txtBy7.Text.Trim().Length == 0) { strErr += "By7不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int id = int.Parse(this.lblid.Text); string name = this.txtname.Text; string beizhu = this.txtbeizhu.Text; decimal By1 = decimal.Parse(this.txtBy1.Text); decimal By2 = decimal.Parse(this.txtBy2.Text); decimal By3 = decimal.Parse(this.txtBy3.Text); string By4 = this.txtBy4.Text; string By5 = this.txtBy5.Text; string By6 = this.txtBy6.Text; string By7 = this.txtBy7.Text; Maticsoft.Model.Position model = new Maticsoft.Model.Position(); model.id = id; model.name = name; model.beizhu = beizhu; model.By1 = By1; model.By2 = By2; model.By3 = By3; model.By4 = By4; model.By5 = By5; model.By6 = By6; model.By7 = By7; Maticsoft.BLL.Position bll = new Maticsoft.BLL.Position(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtadd_u_ID.Text)) { strErr += "用户编号格式错误!\\n"; } if (this.txtadd_contactName.Text.Trim().Length == 0) { strErr += "联系人不能为空!\\n"; } if (this.txtadd_contactPhone.Text.Trim().Length == 0) { strErr += "联系电话不能为空!\\n"; } if (this.txtadd_address.Text.Trim().Length == 0) { strErr += "地址不能为空!\\n"; } if (this.txtadd_counties.Text.Trim().Length == 0) { strErr += "县区不能为空!\\n"; } if (this.txtadd_city.Text.Trim().Length == 0) { strErr += "市不能为空!\\n"; } if (this.txtadd_province.Text.Trim().Length == 0) { strErr += "省不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int add_u_ID = int.Parse(this.txtadd_u_ID.Text); string add_contactName = this.txtadd_contactName.Text; string add_contactPhone = this.txtadd_contactPhone.Text; DateTime add_date = DateTime.Parse(this.txtadd_date.Text); int add_postcode = int.Parse(this.txtadd_postcode.Text); string add_default = this.txtadd_default.Text; string add_address = this.txtadd_address.Text; string add_counties = this.txtadd_counties.Text; string add_city = this.txtadd_city.Text; string add_province = this.txtadd_province.Text; int add_ID = int.Parse(this.lbladd_ID.Text); WalleProject.Model.t_address model = new WalleProject.Model.t_address(); model.add_u_ID = add_u_ID; model.add_contactName = add_contactName; model.add_contactPhone = add_contactPhone; model.add_date = add_date; model.add_postcode = add_postcode; model.add_default = add_default; model.add_address = add_address; model.add_counties = add_counties; model.add_city = add_city; model.add_province = add_province; model.add_ID = add_ID; WalleProject.BLL.t_address bll = new WalleProject.BLL.t_address(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtFailID.Text)) { strErr += "FailID格式错误!\\n"; } if (!PageValidate.IsNumber(txtType.Text)) { strErr += "Type格式错误!\\n"; } if (!PageValidate.IsNumber(txtFlag.Text)) { strErr += "Flag格式错误!\\n"; } if (this.txtName.Text.Trim().Length == 0) { strErr += "Name不能为空!\\n"; } if (!PageValidate.IsDateTime(txtUpLoadTime.Text)) { strErr += "UpLoadTime格式错误!\\n"; } if (this.txtSize.Text.Trim().Length == 0) { strErr += "Size不能为空!\\n"; } if (this.txtPattern.Text.Trim().Length == 0) { strErr += "Pattern不能为空!\\n"; } if (this.txtUrl.Text.Trim().Length == 0) { strErr += "Url不能为空!\\n"; } if (!PageValidate.IsDecimal(txtLocationX.Text)) { strErr += "LocationX格式错误!\\n"; } if (!PageValidate.IsDecimal(txtLocationY.Text)) { strErr += "LocationY格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int ID = int.Parse(this.lblID.Text); int FailID = int.Parse(this.txtFailID.Text); int Type = int.Parse(this.txtType.Text); int Flag = int.Parse(this.txtFlag.Text); string Name = this.txtName.Text; DateTime UpLoadTime = DateTime.Parse(this.txtUpLoadTime.Text); string Size = this.txtSize.Text; string Pattern = this.txtPattern.Text; string Url = this.txtUrl.Text; decimal LocationX = decimal.Parse(this.txtLocationX.Text); decimal LocationY = decimal.Parse(this.txtLocationY.Text); WebDemo.Model.WebDemo.FailureMessage model = new WebDemo.Model.WebDemo.FailureMessage(); model.ID = ID; model.FailID = FailID; model.Type = Type; model.Flag = Flag; model.Name = Name; model.UpLoadTime = UpLoadTime; model.Size = Size; model.Pattern = Pattern; model.Url = Url; model.LocationX = LocationX; model.LocationY = LocationY; WebDemo.BLL.WebDemo.FailureMessage bll = new WebDemo.BLL.WebDemo.FailureMessage(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btn_Login_Click1(object sender, EventArgs e) { Console.WriteLine(Session["CheckCode"]); #region 检查验证码 if ((Session["CheckCode"] != null) && (Session["CheckCode"].ToString() != "")) { if (Session["CheckCode"].ToString().ToLower() != this.CheckCode.Value.ToLower()) { this.lblMsg.Text = "输入的验证码有误!"; Session["CheckCode"] = null; return; } else { this.lblMsg.Text = ""; Session["CheckCode"] = null; string userName = PageValidate.InputText(input_userName.Text.Trim(), 30); string Password = MD5Enctypt.MD5.Md5Encrypt(PageValidate.InputText(input_passWord.Text.Trim(), 30)); string Password2 = MD5Enctypt.MD5.Md5Encrypt(PageValidate.InputText(input_passWord2.Text.Trim(), 30)); string address = PageValidate.InputText(input_Address.Text.Trim(), 100); string phone = PageValidate.InputText(input_phone.Text.Trim(), 15); string name = PageValidate.InputText(input_Name.Text.Trim(), 30); string idnumber = PageValidate.InputText(input_IDnumber.Text.Trim(), 4); BLL.t_user t_User = new BLL.t_user(); bool isPhoneExists = t_User.Exists(phone); if (isPhoneExists) { this.lblMsg.Text = "您输入的电话号码已经注册!"; Response.Write("<script> alert('您输入电话号码已经注册!')</script>"); } if (Password != Password2) { this.lblMsg.Text = "两次密码不匹配!"; Response.Write("<script> alert('两次密码不匹配!')</script>"); } if (!PageValidate.IsNumber(idnumber)) { this.lblMsg.Text = "您输入的身份证号码不是数字!"; Response.Write("<script> alert('您输入的身份证号码不是数字!')</script>"); } else { Model.t_user user = new Model.t_user(); user.u_address = ddl_p.Items[ddl_p.SelectedIndex].Text + ddl_c.Items[ddl_c.SelectedIndex].Text + ddl_d.Items[ddl_d.SelectedIndex].Text + input_Address.Text; user.u_birthDate = DateTime.Parse(this.input_birthdate.Text); user.u_creaditsLogID = int.Parse(this.input_IDnumber.Text); user.u_name = input_Name.Text; user.u_phone = input_phone.Text; user.u_registrationDate = DateTime.Now; user.u_nickName = input_userName.Text; user.u_passWord = Password; t_User.Add(user); Model.t_address addressF = new Model.t_address(); addressF.add_contactName = user.u_name; addressF.add_u_ID = new BLL.t_user().GetModel(user.u_phone).u_ID; addressF.add_contactPhone = user.u_phone; addressF.add_address = input_Address.Text; addressF.add_province = ddl_p.Items[ddl_p.SelectedIndex].Text; addressF.add_counties = ddl_d.Items[ddl_d.SelectedIndex].Text; addressF.add_city = ddl_c.Items[ddl_c.SelectedIndex].Text; addressF.add_date = DateTime.Now; addressF.add_default = "1"; new BLL.t_address().Add(addressF); Response.Write("<script> alert('成功注册,回到登录页面!')</script>"); Response.Redirect("../User/UserLogin.aspx"); } #region ////验证登录信息,如果验证通过则返回当前用户对象的安全上下文信息 //// AccountsPrincipal newUser = AccountsPrincipal.ValidateLogin(userName, Password); //BLL.t_user user = new BLL.t_user(); //if (isNumber) //{ // if (user.Exists(int.Parse(userName))) // { // if (user.IsLogin(int.Parse(userName), Password)) // { // WalleProject.Model.t_user _user = new WalleProject.Model.t_user(); // _user = user.GetModel(int.Parse(userName)); // Session["UserInfo"] = _user; // HttpCookie cookie = new HttpCookie("USER_NAME"); // cookie.Value = input_userName.Text; // Response.Cookies.Add(cookie); // Response.Redirect("../User/Default.aspx"); // } // else // { // this.lblMsg.Text = "您输入的密码不正确!"; // Response.Write("<script>alert('您输入的密码不正确!')</script>"); // } // } // else // { // this.lblMsg.Text = "您输入的用户名不存在!"; // Response.Write("<script> alert('您输入的用户名不存在!')</script>"); // } //} #endregion } } else { Response.Redirect("../User/UserRigister.aspx"); } #endregion #region /* * if (newUser == null)//登录信息不对 * { * this.lblMsg.Text = "登陆失败: " + userName; * if ((Session["PassErrorCountAdmin"] != null) && (Session["PassErrorCountAdmin"].ToString() != "")) * { * int PassErroeCount = Convert.ToInt32(Session["PassErrorCountAdmin"]); * Session["PassErrorCountAdmin"] = PassErroeCount + 1; * } * else * { * Session["PassErrorCountAdmin"] = 1; * } * } * else * { * * //根据用户对象的上下文得到用户对象信息,用于得到其他信息 * User currentUser = new LTP.Accounts.Bus.User(newUser); * //if (currentUser.UserType != "AA") * //{ * // this.lblMsg.Text = "你非管理员用户,你没有权限登录后台系统!"; * // return; * //} * * //把当前用户对象实例赋给Context.User,这样做将会把完整的用户信息加载到ASP.NET提供的验证体系中 * Context.User = newUser; * //验证当前用户密码 * if (((SiteIdentity)User.Identity).TestPassword(Password) == 0) * { * this.lblMsg.Text = "你的密码无效!"; * if ((Session["PassErrorCountAdmin"] != null) && (Session["PassErrorCountAdmin"].ToString() != "")) * { * int PassErroeCount = Convert.ToInt32(Session["PassErrorCountAdmin"]); * Session["PassErrorCountAdmin"] = PassErroeCount + 1; * } * else * { * Session["PassErrorCountAdmin"] = 1; * } * } * else * { * //保存当前用户对象信息 * FormsAuthentication.SetAuthCookie(userName, false); * Session["UserInfo"] = currentUser; * Session["Style"] = currentUser.Style; * if (Session["returnPage"] != null) * { * string returnpage = Session["returnPage"].ToString(); * Session["returnPage"] = null; * Response.Redirect(returnpage); * } * else * { * Response.Redirect("main.htm"); * } * } * * }*/ #endregion }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtID.Text)) { strErr += "ID格式错误!\\n"; } if (this.txtTitle.Text.Trim().Length == 0) { strErr += "Title不能为空!\\n"; } if (this.txtContent.Text.Trim().Length == 0) { strErr += "Content不能为空!\\n"; } if (!PageValidate.IsNumber(txtlevelMax.Text)) { strErr += "levelMax格式错误!\\n"; } if (!PageValidate.IsNumber(txtCID.Text)) { strErr += "CID格式错误!\\n"; } if (!PageValidate.IsDateTime(txtAddTime.Text)) { strErr += "AddTime格式错误!\\n"; } if (!PageValidate.IsDateTime(txtModifytime.Text)) { strErr += "Modifytime格式错误!\\n"; } if (!PageValidate.IsNumber(txtclick.Text)) { strErr += "click格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int ID = int.Parse(this.txtID.Text); string Title = this.txtTitle.Text; string Content = this.txtContent.Text; int levelMax = int.Parse(this.txtlevelMax.Text); int CID = int.Parse(this.txtCID.Text); DateTime AddTime = DateTime.Parse(this.txtAddTime.Text); DateTime Modifytime = DateTime.Parse(this.txtModifytime.Text); int click = int.Parse(this.txtclick.Text); MVCLite.Model.Article model = new MVCLite.Model.Article(); model.ID = ID; model.Title = Title; model.Content = Content; model.levelMax = levelMax; model.CID = CID; model.AddTime = AddTime; model.Modifytime = Modifytime; model.click = click; MVCLite.BLL.Article bll = new MVCLite.BLL.Article(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtINTERNAL_CODE.Text.Trim().Length == 0) { strErr += "INTERNAL_CODE不能为空!\\n"; } if (this.txtCOMPANY_CODE.Text.Trim().Length == 0) { strErr += "COMPANY_CODE不能为空!\\n"; } if (this.txtITEM_CODE.Text.Trim().Length == 0) { strErr += "ITEM_CODE不能为空!\\n"; } if (this.txtITEM_NAME.Text.Trim().Length == 0) { strErr += "ITEM_NAME不能为空!\\n"; } if (this.txtCOLOR.Text.Trim().Length == 0) { strErr += "COLOR不能为空!\\n"; } if (!PageValidate.IsDecimal(txtALL_PRICE.Text)) { strErr += "ALL_PRICE格式错误!\\n"; } if (this.txtCREATE_NAME.Text.Trim().Length == 0) { strErr += "CREATE_NAME不能为空!\\n"; } if (this.txtCREATE_DATE.Text.Trim().Length == 0) { strErr += "CREATE_DATE不能为空!\\n"; } if (this.txtUPDATE_NAME.Text.Trim().Length == 0) { strErr += "UPDATE_NAME不能为空!\\n"; } if (this.txtUPDATE_DATE.Text.Trim().Length == 0) { strErr += "UPDATE_DATE不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string INTERNAL_CODE = this.txtINTERNAL_CODE.Text; string COMPANY_CODE = this.txtCOMPANY_CODE.Text; string ITEM_CODE = this.txtITEM_CODE.Text; string ITEM_NAME = this.txtITEM_NAME.Text; string COLOR = this.txtCOLOR.Text; decimal ALL_PRICE = decimal.Parse(this.txtALL_PRICE.Text); string CREATE_NAME = this.txtCREATE_NAME.Text; string CREATE_DATE = this.txtCREATE_DATE.Text; string UPDATE_NAME = this.txtUPDATE_NAME.Text; string UPDATE_DATE = this.txtUPDATE_DATE.Text; MyERP.Model.PUB_PRICE model = new MyERP.Model.PUB_PRICE(); model.INTERNAL_CODE = INTERNAL_CODE; model.COMPANY_CODE = COMPANY_CODE; model.ITEM_CODE = ITEM_CODE; model.ITEM_NAME = ITEM_NAME; model.COLOR = COLOR; model.ALL_PRICE = ALL_PRICE; model.CREATE_NAME = CREATE_NAME; model.CREATE_DATE = CREATE_DATE; model.UPDATE_NAME = UPDATE_NAME; model.UPDATE_DATE = UPDATE_DATE; MyERP.BLL.PUB_PRICE bll = new MyERP.BLL.PUB_PRICE(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtInID.Text)) { strErr += "InID格式错误!\\n"; } if (this.txtInCode.Text.Trim().Length == 0) { strErr += "InCode不能为空!\\n"; } if (!PageValidate.IsNumber(txtInNumber.Text)) { strErr += "InNumber格式错误!\\n"; } if (!PageValidate.IsNumber(txtSiteID.Text)) { strErr += "SiteID格式错误!\\n"; } if (this.txtOperatorName.Text.Trim().Length == 0) { strErr += "OperatorName不能为空!\\n"; } if (!PageValidate.IsDateTime(txtGetDate.Text)) { strErr += "GetDate格式错误!\\n"; } if (!PageValidate.IsNumber(txtPayID.Text)) { strErr += "PayID格式错误!\\n"; } if (!PageValidate.IsDateTime(txtPrintDate.Text)) { strErr += "PrintDate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtInMoney.Text)) { strErr += "InMoney格式错误!\\n"; } if (!PageValidate.IsNumber(txtInMark.Text)) { strErr += "InMark格式错误!\\n"; } if (!PageValidate.IsNumber(txtSendMark.Text)) { strErr += "SendMark格式错误!\\n"; } if (!PageValidate.IsDateTime(txtSendDate.Text)) { strErr += "SendDate格式错误!\\n"; } if (this.txtprintMan.Text.Trim().Length == 0) { strErr += "printMan不能为空!\\n"; } if (!PageValidate.IsDateTime(txtzfDate.Text)) { strErr += "zfDate格式错误!\\n"; } if (this.txtzfInCode.Text.Trim().Length == 0) { strErr += "zfInCode不能为空!\\n"; } if (this.txtzfInNumber.Text.Trim().Length == 0) { strErr += "zfInNumber不能为空!\\n"; } if (this.txtUName.Text.Trim().Length == 0) { strErr += "UName不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int InID = int.Parse(this.txtInID.Text); string InCode = this.txtInCode.Text; int InNumber = int.Parse(this.txtInNumber.Text); int SiteID = int.Parse(this.txtSiteID.Text); string OperatorName = this.txtOperatorName.Text; DateTime GetDate = DateTime.Parse(this.txtGetDate.Text); int PayID = int.Parse(this.txtPayID.Text); DateTime PrintDate = DateTime.Parse(this.txtPrintDate.Text); decimal InMoney = decimal.Parse(this.txtInMoney.Text); int InMark = int.Parse(this.txtInMark.Text); int SendMark = int.Parse(this.txtSendMark.Text); DateTime SendDate = DateTime.Parse(this.txtSendDate.Text); string printMan = this.txtprintMan.Text; DateTime zfDate = DateTime.Parse(this.txtzfDate.Text); string zfInCode = this.txtzfInCode.Text; string zfInNumber = this.txtzfInNumber.Text; string UName = this.txtUName.Text; WebDemo.Model.WebDemo.InvoiceList model = new WebDemo.Model.WebDemo.InvoiceList(); model.InID = InID; model.InCode = InCode; model.InNumber = InNumber; model.SiteID = SiteID; model.OperatorName = OperatorName; model.GetDate = GetDate; model.PayID = PayID; model.PrintDate = PrintDate; model.InMoney = InMoney; model.InMark = InMark; model.SendMark = SendMark; model.SendDate = SendDate; model.printMan = printMan; model.zfDate = zfDate; model.zfInCode = zfInCode; model.zfInNumber = zfInNumber; model.UName = UName; WebDemo.BLL.WebDemo.InvoiceList bll = new WebDemo.BLL.WebDemo.InvoiceList(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
//public void BankBind() //{ // string strBankName = new lgk.BLL.tb_bankName().GetModel(1).BankName; // string[] a = strBankName.Split(','); // ListItem item_list = new ListItem(); // item_list.Value = "0"; // item_list.Text = GetLanguage("PleaseSselect");//"-请选择-" // this.OutBank.Items.Add(item_list); // foreach (string b in a) // { // ListItem item_list1 = new ListItem(); // item_list1.Value = b; // item_list1.Text = b; // this.OutBank.Items.Add(item_list1); // } //} /// <summary> /// 申请记录查询条件 /// </summary> /// <returns></returns> private string GetWhere() { string strWhere = ""; string strStartTime = txtStart.Text.Trim(); string strEndTime = txtEnd.Text.Trim(); strWhere = " r.Remit001=1 and r.UserID=" + getLoginID(); //if (this.dropLevel.SelectedValue != "0" && this.dropLevel.SelectedValue != "") //{ // strWhere += " and LevelID=" + dropLevel.SelectedValue; //} if (strStartTime != "" && strEndTime == "" && PageValidate.IsDateTime(strStartTime)) { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) >= '" + strStartTime + "'"); } else if (strStartTime == "" && strEndTime != "" && PageValidate.IsDateTime(strEndTime)) { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) <= '" + strEndTime + "'"); } else if (strStartTime != "" && strEndTime != "" && PageValidate.IsDateTime(strStartTime) && PageValidate.IsDateTime(strEndTime)) { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) between '" + strStartTime + "' and '" + strEndTime + "'"); } return(strWhere); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtname.Text.Trim().Length == 0) { strErr += "name不能为空!\\n"; } if (this.txtteam.Text.Trim().Length == 0) { strErr += "team不能为空!\\n"; } if (this.txtquestion.Text.Trim().Length == 0) { strErr += "question不能为空!\\n"; } if (!PageValidate.IsDateTime(txttime.Text)) { strErr += "time格式错误!\\n"; } if (!PageValidate.IsNumber(txtpassword.Text)) { strErr += "password格式错误!\\n"; } if (!PageValidate.IsNumber(txtpeixunban.Text)) { strErr += "peixunban格式错误!\\n"; } if (!PageValidate.IsNumber(txtfenshu.Text)) { strErr += "fenshu格式错误!\\n"; } if (!PageValidate.IsNumber(txtstyle.Text)) { strErr += "style格式错误!\\n"; } if (this.txtbeizhu.Text.Trim().Length == 0) { strErr += "beizhu不能为空!\\n"; } if (this.txtbeizhu2.Text.Trim().Length == 0) { strErr += "beizhu2不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string name = this.txtname.Text; string team = this.txtteam.Text; string question = this.txtquestion.Text; DateTime time = DateTime.Parse(this.txttime.Text); int password = int.Parse(this.txtpassword.Text); int peixunban = int.Parse(this.txtpeixunban.Text); int fenshu = int.Parse(this.txtfenshu.Text); int style = int.Parse(this.txtstyle.Text); string beizhu = this.txtbeizhu.Text; string beizhu2 = this.txtbeizhu2.Text; Maticsoft.Model.forum_q model = new Maticsoft.Model.forum_q(); model.name = name; model.team = team; model.question = question; model.time = time; model.password = password; model.peixunban = peixunban; model.fenshu = fenshu; model.style = style; model.beizhu = beizhu; model.beizhu2 = beizhu2; Maticsoft.BLL.forum_q bll = new Maticsoft.BLL.forum_q(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtOperID.Text)) { strErr += "业务编号格式错误!\\n"; } if (!PageValidate.IsNumber(txtFareID.Text)) { strErr += "FareID格式错误!\\n"; } if (this.txtFareTypeName.Text.Trim().Length == 0) { strErr += "费用名称不能为空!\\n"; } if (!PageValidate.IsDecimal(txtFarePrice.Text)) { strErr += "单价格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFareMoney.Text)) { strErr += "金额格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFareMoney1.Text)) { strErr += "FareMoney1格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFarePrice2.Text)) { strErr += "FarePrice2格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFareMoney2.Text)) { strErr += "FareMoney2格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFarePrice3.Text)) { strErr += "FarePrice3格式错误!\\n"; } if (!PageValidate.IsDecimal(txtFareMoney3.Text)) { strErr += "FareMoney3格式错误!\\n"; } if (!PageValidate.IsDecimal(txtTaxRate.Text)) { strErr += "TaxRate格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int OperID = int.Parse(this.txtOperID.Text); int FareID = int.Parse(this.txtFareID.Text); string FareTypeName = this.txtFareTypeName.Text; decimal FarePrice = decimal.Parse(this.txtFarePrice.Text); decimal FareMoney = decimal.Parse(this.txtFareMoney.Text); decimal FareMoney1 = decimal.Parse(this.txtFareMoney1.Text); decimal FarePrice2 = decimal.Parse(this.txtFarePrice2.Text); decimal FareMoney2 = decimal.Parse(this.txtFareMoney2.Text); decimal FarePrice3 = decimal.Parse(this.txtFarePrice3.Text); decimal FareMoney3 = decimal.Parse(this.txtFareMoney3.Text); decimal TaxRate = decimal.Parse(this.txtTaxRate.Text); WebDemo.Model.WebDemo.PreOperationFare model = new WebDemo.Model.WebDemo.PreOperationFare(); model.OperID = OperID; model.FareID = FareID; model.FareTypeName = FareTypeName; model.FarePrice = FarePrice; model.FareMoney = FareMoney; model.FareMoney1 = FareMoney1; model.FarePrice2 = FarePrice2; model.FareMoney2 = FareMoney2; model.FarePrice3 = FarePrice3; model.FareMoney3 = FareMoney3; model.TaxRate = TaxRate; WebDemo.BLL.WebDemo.PreOperationFare bll = new WebDemo.BLL.WebDemo.PreOperationFare(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; HttpRequest request = context.Request; BLL.hr_department dep = new BLL.hr_department(); Model.hr_department model = new Model.hr_department(); var cookie = context.Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); string CoockiesID = ticket.UserData; BLL.hr_employee emp = new BLL.hr_employee(); int emp_id = int.Parse(CoockiesID); DataSet dsemp = emp.GetList("id=" + emp_id); string empname = dsemp.Tables[0].Rows[0]["name"].ToString(); string uid = dsemp.Tables[0].Rows[0]["uid"].ToString(); if (request["Action"] == "department") { string did = PageValidate.InputText(request["did"], 50); if (!string.IsNullOrEmpty(did)) { DataSet ds; if (did == "-2") { //ds = dep.GetList(" ISNULL(isDelete,0)=0 and parentid=0 ");//sqlserver专用 ds = dep.GetList(" IfNULL(isDelete,0)=0 and parentid=0 "); } else { ds = dep.GetList(" id=" + int.Parse(did)); } string outstring = did + ","; outstring += ds.Tables[0].Rows[0]["d_name"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_fuzeren"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_tel"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_fax"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_add"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_email"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_miaoshu"].ToString() + ","; outstring += ds.Tables[0].Rows[0]["d_order"].ToString(); context.Response.Write(outstring); } } if (request["Action"] == "deptree") { DataSet ds = dep.GetAllList(); StringBuilder str = new StringBuilder(); str.Append("["); str.Append("{id:0,text:'无',d_icon:''},"); str.Append(GetTreeString(0, ds.Tables[0], null)); str.Replace(",", "", str.Length - 1, 1); str.Append("]"); context.Response.Write(str); } if (request["Action"] == "treegrid") { DataSet ds = dep.GetAllList(); string dt = "{Rows:[" + GetTasksString(0, ds.Tables[0]) + "]}"; context.Response.Write(dt); } if (request["Action"] == "tree") { string serchtxt = " 1=1 "; string authtxt = PageValidate.InputText(request["auth"], 50); if (!string.IsNullOrEmpty(authtxt)) { Data.GetDataAuth dataauth = new Data.GetDataAuth(); string txt = dataauth.GetDataAuthByid(authtxt, "Sys_add", emp_id.ToString()); string[] arr = txt.Split(':'); switch (arr[0]) { case "my": case "dep": string did = dsemp.Tables[0].Rows[0]["d_id"].ToString(); if (string.IsNullOrEmpty(did)) { did = "0"; } authtxt = did; break; case "all": authtxt = "0"; break; case "depall": DataSet dsdep = dep.GetAllList(); string deptask = GetDepTask(int.Parse(arr[1]), dsdep.Tables[0]); string intext = arr[1] + "," + deptask; authtxt = intext.TrimEnd(','); break; } } //context.Response.Write(authtxt); DataSet ds = dep.GetList(0, serchtxt, " d_order"); StringBuilder str = new StringBuilder(); str.Append("["); str.Append(GetTreeString(0, ds.Tables[0], authtxt)); str.Replace(",", "", str.Length - 1, 1); str.Append("]"); context.Response.Write(str); } //Form JSON if (request["Action"] == "form") { int depid = int.Parse(request["id"]); DataSet ds = dep.GetList("id=" + depid); string dt = Common.DataToJson.DataToJSON(ds); context.Response.Write(dt); } //save if (request["Action"] == "save") { string parentid;//= string.IsNullOrEmpty(request["T_parent"]) ? "0" : request["T_parentid"]; if (string.IsNullOrEmpty(request["T_parent_val"]) || request["T_parent_val"] == "null") { parentid = "0"; } else { parentid = request["T_parent_val"]; } model.d_name = PageValidate.InputText(request["T_depname"], 255); model.parentid = int.Parse(parentid); model.parentname = PageValidate.InputText(request["T_parent"], 250); model.d_type = PageValidate.InputText(request["T_deptype"], 250); model.d_order = int.Parse(request["T_sort"]); model.d_fuzeren = PageValidate.InputText(request["T_leader"], 255); model.d_tel = PageValidate.InputText(request["T_tel"], 255); model.d_email = PageValidate.InputText(request["T_email"], 255); model.d_fax = PageValidate.InputText(request["T_fax"], 255); model.d_add = PageValidate.InputText(request["T_add"], 255); model.d_miaoshu = PageValidate.InputText(request["T_descript"], 255); if (model.d_type == "部门") { model.d_icon = "images/icon/88.png"; } else { model.d_icon = "images/icon/61.png"; } string id = request["id"]; if (!string.IsNullOrEmpty(id) && id != "null") { model.id = int.Parse(id); DataSet ds = dep.GetList("id=" + int.Parse(id)); DataRow dr = ds.Tables[0].Rows[0]; dep.Update(model); //日志 C_Sys_log log = new C_Sys_log(); int UserID = emp_id; string UserName = empname; string IPStreet = request.UserHostAddress; string EventTitle = model.d_name; string EventType = "组织架构修改"; int EventID = model.id; if (dr["d_name"].ToString() != request["T_depname"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "机构名称", dr["d_name"].ToString(), request["T_depname"]); } if (dr["parentname"].ToString() != request["T_parent"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "上级机构", dr["parentname"].ToString(), request["T_parent"]); } if (dr["d_type"].ToString() != request["T_deptype"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "机构类型", dr["d_type"].ToString(), request["T_deptype"]); } if (dr["d_order"].ToString() != request["T_sort"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "部门排序", dr["d_order"].ToString(), request["T_sort"]); } if (dr["d_fuzeren"].ToString() != request["T_leader"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "负责人", dr["d_fuzeren"].ToString(), request["T_leader"]); } if (dr["d_tel"].ToString() != request["T_tel"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "电话", dr["d_tel"].ToString(), request["T_tel"]); } if (dr["d_email"].ToString() != request["T_email"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "邮箱", dr["d_email"].ToString(), request["T_email"]); } if (dr["d_fax"].ToString() != request["T_fax"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "传真", dr["d_fax"].ToString(), request["T_fax"]); } if (dr["d_add"].ToString() != request["T_add"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "地址", dr["d_add"].ToString(), request["T_add"]); } if (dr["d_miaoshu"].ToString() != request["T_descript"]) { log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, "描述", dr["d_miaoshu"].ToString(), request["T_descript"]); } } else { model.isDelete = 0; dep.Add(model); } } //del if (request.Params["Action"] == "del") { int d_id = int.Parse(request["id"]); string EventType = "组织架构删除"; DataSet ds = emp.GetList("d_id = " + d_id); BLL.hr_post post = new BLL.hr_post(); if (d_id == 1) { //根目录不能删除 context.Response.Write("false:first"); } else if (post.GetList("dep_id=" + d_id).Tables[0].Rows.Count > 0) { //含有岗位信息不能删除 context.Response.Write("false:post"); } else if (emp.GetList("d_id=" + d_id).Tables[0].Rows.Count > 0) { //含有员工信息不能删除 context.Response.Write("false:emp"); } else { bool isdel = dep.Delete(d_id); if (isdel) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int UserID = emp_id; string UserName = empname; string IPStreet = request.UserHostAddress; int EventID = d_id; string EventTitle = ds.Tables[0].Rows[i]["d_name"].ToString(); string Original_txt = null; string Current_txt = null; C_Sys_log log = new C_Sys_log(); log.Add_log(UserID, UserName, IPStreet, EventTitle, EventType, EventID, null, Original_txt, Current_txt); } context.Response.Write("true"); } else { context.Response.Write("false"); } } } }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtlibarayName.Text.Trim().Length == 0) { strErr += "libarayName不能为空!\\n"; } if (this.txtcurator.Text.Trim().Length == 0) { strErr += "curator不能为空!\\n"; } if (this.txttel.Text.Trim().Length == 0) { strErr += "tel不能为空!\\n"; } if (this.txtAddresss.Text.Trim().Length == 0) { strErr += "Addresss不能为空!\\n"; } if (this.txtemail.Text.Trim().Length == 0) { strErr += "email不能为空!\\n"; } if (this.txturl.Text.Trim().Length == 0) { strErr += "url不能为空!\\n"; } if (!PageValidate.IsDateTime(txtcreateDate.Text)) { strErr += "createDate格式错误!\\n"; } if (this.txtremark.Text.Trim().Length == 0) { strErr += "remark不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string libarayName = this.txtlibarayName.Text; string curator = this.txtcurator.Text; string tel = this.txttel.Text; string Addresss = this.txtAddresss.Text; string email = this.txtemail.Text; string url = this.txturl.Text; DateTime createDate = DateTime.Parse(this.txtcreateDate.Text); string remark = this.txtremark.Text; YueDuLibrary.Model.Library model = new YueDuLibrary.Model.Library(); model.libarayName = libarayName; model.curator = curator; model.tel = tel; model.Addresss = Addresss; model.email = email; model.url = url; model.createDate = createDate; model.remark = remark; YueDuLibrary.BLL.Library bll = new YueDuLibrary.BLL.Library(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtTitle.Text.Trim().Length == 0) { strErr += "Title不能为空!\\n"; } if (this.txtAuthor.Text.Trim().Length == 0) { strErr += "Author不能为空!\\n"; } if (!PageValidate.IsDateTime(txtPublishDate.Text)) { strErr += "PublishDate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtUnitPrice.Text)) { strErr += "UnitPrice格式错误!\\n"; } if (this.txtTOC.Text.Trim().Length == 0) { strErr += "TOC不能为空!\\n"; } if (!PageValidate.IsNumber(txtClicks.Text)) { strErr += "Clicks格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string Title = this.txtTitle.Text; string Author = this.txtAuthor.Text; int PublisherId = int.Parse(ddlPublisher.SelectedValue); DateTime PublishDate = DateTime.Parse(this.txtPublishDate.Text); string ISBN = this.lblISBN.Text; decimal UnitPrice = decimal.Parse(this.txtUnitPrice.Text); string ContentDescription = this.FCKeditor1.Value; string TOC = this.txtTOC.Text; int CategoryId = int.Parse(this.ddlCategory.SelectedValue); int Clicks = int.Parse(this.txtClicks.Text); OLBookstore.Model.Books model = new OLBookstore.Model.Books(); model.Title = Title; model.Author = Author; model.PublisherId = PublisherId; model.PublishDate = PublishDate; model.ISBN = ISBN; model.UnitPrice = UnitPrice; model.ContentDescription = ContentDescription; model.TOC = TOC; model.CategoryId = CategoryId; model.Clicks = Clicks; OLBookstore.BLL.BooksManager bll = new OLBookstore.BLL.BooksManager(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtitem_name.Text.Trim().Length == 0) { strErr += "item_name不能为空!\\n"; } if (this.txtitem_remark.Text.Trim().Length == 0) { strErr += "item_remark不能为空!\\n"; } if (this.txtitem_desc.Text.Trim().Length == 0) { strErr += "item_desc不能为空!\\n"; } if (!PageValidate.IsNumber(txtkind_id.Text)) { strErr += "kind_id格式错误!\\n"; } if (!PageValidate.IsDateTime(txtaddtime.Text)) { strErr += "addtime格式错误!\\n"; } if (!PageValidate.IsDateTime(txtendtime.Text)) { strErr += "endtime格式错误!\\n"; } if (this.txtinit_price.Text.Trim().Length == 0) { strErr += "init_price不能为空!\\n"; } if (this.txtmax_price.Text.Trim().Length == 0) { strErr += "max_price不能为空!\\n"; } if (!PageValidate.IsNumber(txtowner_id.Text)) { strErr += "owner_id格式错误!\\n"; } if (!PageValidate.IsNumber(txtwiner_id.Text)) { strErr += "winer_id格式错误!\\n"; } if (!PageValidate.IsNumber(txtstate_id.Text)) { strErr += "state_id格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string item_name = this.txtitem_name.Text; string item_remark = this.txtitem_remark.Text; string item_desc = this.txtitem_desc.Text; int kind_id = int.Parse(this.txtkind_id.Text); DateTime addtime = DateTime.Parse(this.txtaddtime.Text); DateTime endtime = DateTime.Parse(this.txtendtime.Text); string init_price = this.txtinit_price.Text; string max_price = this.txtmax_price.Text; int owner_id = int.Parse(this.txtowner_id.Text); int winer_id = int.Parse(this.txtwiner_id.Text); int state_id = int.Parse(this.txtstate_id.Text); Auction.Model.item model = new Auction.Model.item(); model.item_name = item_name; model.item_remark = item_remark; model.item_desc = item_desc; model.kind_id = kind_id; model.addtime = addtime; model.endtime = endtime; model.init_price = init_price; model.max_price = max_price; model.owner_id = owner_id; model.winer_id = winer_id; model.state_id = state_id; Auction.BLL.item bll = new Auction.BLL.item(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtPrj_No.Text.Trim().Length == 0) { strErr += "Prj_No不能为空!\\n"; } if (this.txtPrj_Name.Text.Trim().Length == 0) { strErr += "Prj_Name不能为空!\\n"; } if (this.txtExp_No.Text.Trim().Length == 0) { strErr += "Exp_No不能为空!\\n"; } if (this.txtMapCode.Text.Trim().Length == 0) { strErr += "MapCode不能为空!\\n"; } if (this.txtSewageSystem_ID.Text.Trim().Length == 0) { strErr += "SewageSystem_ID不能为空!\\n"; } if (this.txtStormSystem_ID.Text.Trim().Length == 0) { strErr += "StormSystem_ID不能为空!\\n"; } if (this.txtType.Text.Trim().Length == 0) { strErr += "Type不能为空!\\n"; } if (!PageValidate.IsDecimal(txtX.Text)) { strErr += "X格式错误!\\n"; } if (!PageValidate.IsDecimal(txtY.Text)) { strErr += "Y格式错误!\\n"; } if (!PageValidate.IsDecimal(txtHigh.Text)) { strErr += "High格式错误!\\n"; } if (!PageValidate.IsDecimal(txtTop_Ele.Text)) { strErr += "Top_Ele格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBot_Ele.Text)) { strErr += "Bot_Ele格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWidth.Text)) { strErr += "Width格式错误!\\n"; } if (this.txtCode.Text.Trim().Length == 0) { strErr += "Code不能为空!\\n"; } if (this.txtAddress.Text.Trim().Length == 0) { strErr += "Address不能为空!\\n"; } if (!PageValidate.IsNumber(txtPointPosition.Text)) { strErr += "PointPosition格式错误!\\n"; } if (this.txtDataSource.Text.Trim().Length == 0) { strErr += "DataSource不能为空!\\n"; } if (this.txtVisibility.Text.Trim().Length == 0) { strErr += "Visibility不能为空!\\n"; } if (this.txtSunit.Text.Trim().Length == 0) { strErr += "Sunit不能为空!\\n"; } if (this.txtSdate.Text.Trim().Length == 0) { strErr += "Sdate不能为空!\\n"; } if (this.txtUpdateTime.Text.Trim().Length == 0) { strErr += "UpdateTime不能为空!\\n"; } if (this.txtMdate.Text.Trim().Length == 0) { strErr += "Mdate不能为空!\\n"; } if (this.txtDataListID.Text.Trim().Length == 0) { strErr += "DataListID不能为空!\\n"; } if (this.txtStatus.Text.Trim().Length == 0) { strErr += "Status不能为空!\\n"; } if (this.txtEname.Text.Trim().Length == 0) { strErr += "Ename不能为空!\\n"; } if (this.txtDesign_Dept.Text.Trim().Length == 0) { strErr += "Design_Dept不能为空!\\n"; } if (this.txtConster_Dept.Text.Trim().Length == 0) { strErr += "Conster_Dept不能为空!\\n"; } if (this.txtBelong.Text.Trim().Length == 0) { strErr += "Belong不能为空!\\n"; } if (this.txtOperator.Text.Trim().Length == 0) { strErr += "Operator不能为空!\\n"; } if (this.txtNote.Text.Trim().Length == 0) { strErr += "Note不能为空!\\n"; } if (this.txtExp_NoOri.Text.Trim().Length == 0) { strErr += "Exp_NoOri不能为空!\\n"; } if (this.txtfilename.Text.Trim().Length == 0) { strErr += "filename不能为空!\\n"; } if (this.txtupdate.Text.Trim().Length == 0) { strErr += "update不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string Prj_No = this.txtPrj_No.Text; string Prj_Name = this.txtPrj_Name.Text; string Exp_No = this.txtExp_No.Text; string MapCode = this.txtMapCode.Text; string SewageSystem_ID = this.txtSewageSystem_ID.Text; string StormSystem_ID = this.txtStormSystem_ID.Text; string Type = this.txtType.Text; decimal X = decimal.Parse(this.txtX.Text); decimal Y = decimal.Parse(this.txtY.Text); decimal High = decimal.Parse(this.txtHigh.Text); decimal Top_Ele = decimal.Parse(this.txtTop_Ele.Text); decimal Bot_Ele = decimal.Parse(this.txtBot_Ele.Text); decimal Width = decimal.Parse(this.txtWidth.Text); string Code = this.txtCode.Text; string Address = this.txtAddress.Text; int PointPosition = int.Parse(this.txtPointPosition.Text); string DataSource = this.txtDataSource.Text; string Visibility = this.txtVisibility.Text; string Sunit = this.txtSunit.Text; string Sdate = this.txtSdate.Text; string UpdateTime = this.txtUpdateTime.Text; string Mdate = this.txtMdate.Text; string DataListID = this.txtDataListID.Text; string Status = this.txtStatus.Text; string Ename = this.txtEname.Text; string Design_Dept = this.txtDesign_Dept.Text; string Conster_Dept = this.txtConster_Dept.Text; string Belong = this.txtBelong.Text; string Operator = this.txtOperator.Text; string Note = this.txtNote.Text; string Exp_NoOri = this.txtExp_NoOri.Text; string filename = this.txtfilename.Text; string update = this.txtupdate.Text; Maticsoft.Model.ps_weir model = new Maticsoft.Model.ps_weir(); model.Prj_No = Prj_No; model.Prj_Name = Prj_Name; model.Exp_No = Exp_No; model.MapCode = MapCode; model.SewageSystem_ID = SewageSystem_ID; model.StormSystem_ID = StormSystem_ID; model.Type = Type; model.X = X; model.Y = Y; model.High = High; model.Top_Ele = Top_Ele; model.Bot_Ele = Bot_Ele; model.Width = Width; model.Code = Code; model.Address = Address; model.PointPosition = PointPosition; model.DataSource = DataSource; model.Visibility = Visibility; model.Sunit = Sunit; model.Sdate = Sdate; model.UpdateTime = UpdateTime; model.Mdate = Mdate; model.DataListID = DataListID; model.Status = Status; model.Ename = Ename; model.Design_Dept = Design_Dept; model.Conster_Dept = Conster_Dept; model.Belong = Belong; model.Operator = Operator; model.Note = Note; model.Exp_NoOri = Exp_NoOri; model.filename = filename; model.update = update; Maticsoft.BLL.ps_weir bll = new Maticsoft.BLL.ps_weir(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
public void binddr() { try { string[] ArrX; string sqlstr = "select * from h_fangyuan where 2>1 "; if (fujia.Text == "") { if (fybh.Text != "") { sqlstr = sqlstr + " and 编号 like '%" + PageValidate.ToLikeSql(fybh.Text.ToString().Trim()) + "%'"; } if (TextBox1.Text != "") { sqlstr = sqlstr + " and 辖区 like '%" + PageValidate.ToLikeSql(TextBox1.Text.ToString().Trim()) + "%'"; } if (TextBox2.Text != "") { sqlstr = sqlstr + " and 街道 like '%" + PageValidate.ToLikeSql(TextBox2.Text.ToString().Trim()) + "%'"; } if (TextBox3.Text != "") { sqlstr = sqlstr + " and 小区 like '%" + PageValidate.ToLikeSql(TextBox3.Text.ToString().Trim()) + "%'"; } if (TextBox4.Text != "") { sqlstr = sqlstr + " and 房屋户型 like '%" + PageValidate.ToLikeSql(TextBox4.Text.ToString().Trim()) + "%'"; } if (TextBox5.Text != "") { ArrX = TextBox5.Text.ToString().Trim().Split('-'); if (ArrX.Length == 1) { sqlstr = sqlstr + " and 建筑面积 = '" + ArrX[0] + "'"; } else if (ArrX.Length == 2) { sqlstr = sqlstr + " and (建筑面积 >= '" + isnull(ArrX[0], "0") + "' and 建筑面积 <= '" + isnull(ArrX[1], "10000000000000") + "')"; } } if (TextBox6.Text != "") { ArrX = TextBox6.Text.ToString().Trim().Split('-'); if (ArrX.Length == 1) { sqlstr = sqlstr + " and 第层 = '" + ArrX[0] + "'"; } else if (ArrX.Length == 2) { sqlstr = sqlstr + " and (第层 >= '" + isnull(ArrX[0], "0") + "' and 第层 <= '" + isnull(ArrX[1], "1000") + "')"; } } if (TextBox7.Text != "") { ArrX = TextBox7.Text.ToString().Trim().Split('-'); if (ArrX.Length == 1) { sqlstr = sqlstr + " and 房主报价 = '" + ArrX[0] + "'"; } else if (ArrX.Length == 2) { sqlstr = sqlstr + " and (房主报价 >= '" + isnull(ArrX[0], "0") + "' and 房主报价 <= '" + isnull(ArrX[1], "1000000000") + "')"; } } } else { ArrX = fujia.Text.ToString().Trim().Split('-'); if (ArrX.Length == 1) { sqlstr = sqlstr + " and (编号 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 辖区 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 街道 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 小区 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 房屋户型 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 产权性质 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 产权证 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or name like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 部门 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 详细地址 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 公交线路 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 环境描述 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 建筑结构 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 使用性质 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 建筑年代 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 房屋现状 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 房屋类型 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 装修状况 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 配套设施 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%' or 房源备注 like '%" + PageValidate.ToLikeSql(fujia.Text.ToString().Trim()) + "%')"; } else if (ArrX.Length == 2) { sqlstr = sqlstr + " and ((建筑面积 >= '" + isnull(ArrX[0], "0") + "' and 建筑面积 <= '" + isnull(ArrX[1], "10000000000000") + "') or (第层 >= '" + isnull(ArrX[0], "0") + "' and 第层 <= '" + isnull(ArrX[1], "1000") + "') or (房主报价 >= '" + isnull(ArrX[0], "0") + "' and 房主报价 <= '" + isnull(ArrX[1], "1000000000") + "'))"; } } if (DropDownList1.SelectedValue != "不限") { sqlstr = sqlstr + " and 售租形式 = '" + DropDownList1.SelectedValue + "'"; } sqlstr = sqlstr + "and 成交状况='未成交' order by ID desc ;"; DataView dv = DbHelperSQL.Query(sqlstr).Tables[0].DefaultView; PagedDataSource pds = new PagedDataSource(); AspNetPager1.RecordCount = dv.Count; pds.DataSource = dv; pds.AllowPaging = true; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.PageSize = AspNetPager1.PageSize; this.Repeater1.DataSource = pds; this.Repeater1.DataBind(); } catch (Exception ex) { if (ex != null) { MessageBox.Show(this, "查询条件输入不符合规则,请重新输入!"); return; } } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCOMPANY_CODE.Text.Trim().Length == 0) { strErr += "COMPANY_CODE不能为空!\\n"; } if (this.txtCOMPANY_NAME.Text.Trim().Length == 0) { strErr += "COMPANY_NAME不能为空!\\n"; } if (this.txtITEM_INTERNAL_CODE.Text.Trim().Length == 0) { strErr += "ITEM_INTERNAL_CODE不能为空!\\n"; } if (this.txtITEM_CODE.Text.Trim().Length == 0) { strErr += "ITEM_CODE不能为空!\\n"; } if (this.txtITEM_NAME.Text.Trim().Length == 0) { strErr += "ITEM_NAME不能为空!\\n"; } if (this.txtPARENT_ITEM_CODE.Text.Trim().Length == 0) { strErr += "PARENT_ITEM_CODE不能为空!\\n"; } if (!PageValidate.IsDecimal(txtACTUAL_QTY.Text)) { strErr += "ACTUAL_QTY格式错误!\\n"; } if (!PageValidate.IsDateTime(txtCREATE_DATE.Text)) { strErr += "CREATE_DATE格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string COMPANY_CODE = this.txtCOMPANY_CODE.Text; string COMPANY_NAME = this.txtCOMPANY_NAME.Text; string ITEM_INTERNAL_CODE = this.txtITEM_INTERNAL_CODE.Text; string ITEM_CODE = this.txtITEM_CODE.Text; string ITEM_NAME = this.txtITEM_NAME.Text; string PARENT_ITEM_CODE = this.txtPARENT_ITEM_CODE.Text; decimal ACTUAL_QTY = decimal.Parse(this.txtACTUAL_QTY.Text); DateTime CREATE_DATE = DateTime.Parse(this.txtCREATE_DATE.Text); MyERP.Model.STEEL_DA_BEGIN model = new MyERP.Model.STEEL_DA_BEGIN(); model.COMPANY_CODE = COMPANY_CODE; model.COMPANY_NAME = COMPANY_NAME; model.ITEM_INTERNAL_CODE = ITEM_INTERNAL_CODE; model.ITEM_CODE = ITEM_CODE; model.ITEM_NAME = ITEM_NAME; model.PARENT_ITEM_CODE = PARENT_ITEM_CODE; model.ACTUAL_QTY = ACTUAL_QTY; model.CREATE_DATE = CREATE_DATE; MyERP.BLL.STEEL_DA_BEGIN bll = new MyERP.BLL.STEEL_DA_BEGIN(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }