private void ShowInfo(int tra_ID) { WalleProject.BLL.t_tradingrecord bll = new WalleProject.BLL.t_tradingrecord(); WalleProject.Model.t_tradingrecord model = bll.GetModel(tra_ID); this.txttra_U_ID.Text = model.tra_U_ID.ToString(); this.txttra_transactionAmount.Text = model.tra_transactionAmount.ToString(); this.txttra_transactionDate.Text = model.tra_transactionDate.ToString(); this.txttra_accomplish.Text = model.tra_accomplish; this.txttra_staff_id.Text = model.tra_staff_id.ToString(); this.txtsta_comwas_id.Text = model.sta_comwas_id.ToString(); this.txttra_number.Text = model.tra_number.ToString(); this.lbltra_ID.Text = model.tra_ID.ToString(); this.txttra_addressID.Text = model.tra_addressID.ToString(); this.txttra_type.Text = model.tra_type; this.txttra_vaild.Text = model.tra_vaild; this.txttra_sort.Text = model.tra_sort.ToString(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txttra_U_ID.Text)) { strErr += "tra_U_ID格式错误!\\n"; } if (!PageValidate.IsDecimal(txttra_transactionAmount.Text)) { strErr += "tra_transactionAmount格式错误!\\n"; } if (!PageValidate.IsDateTime(txttra_transactionDate.Text)) { strErr += "tra_transactionDate格式错误!\\n"; } if (this.txttra_accomplish.Text.Trim().Length == 0) { strErr += "tra_accomplish不能为空!\\n"; } if (!PageValidate.IsNumber(txttra_staff_id.Text)) { strErr += "tra_staff_id格式错误!\\n"; } if (!PageValidate.IsNumber(txtsta_comwas_id.Text)) { strErr += "sta_comwas_id格式错误!\\n"; } if (!PageValidate.IsNumber(txttra_number.Text)) { strErr += "tra_number格式错误!\\n"; } if (!PageValidate.IsNumber(txttra_addressID.Text)) { strErr += "tra_addressID格式错误!\\n"; } if (this.txttra_type.Text.Trim().Length == 0) { strErr += "tra_type不能为空!\\n"; } if (this.txttra_vaild.Text.Trim().Length == 0) { strErr += "tra_vaild不能为空!\\n"; } if (!PageValidate.IsNumber(txttra_sort.Text)) { strErr += "tra_sort格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int tra_U_ID = int.Parse(this.txttra_U_ID.Text); decimal tra_transactionAmount = decimal.Parse(this.txttra_transactionAmount.Text); DateTime tra_transactionDate = DateTime.Parse(this.txttra_transactionDate.Text); string tra_accomplish = this.txttra_accomplish.Text; int tra_staff_id = int.Parse(this.txttra_staff_id.Text); int sta_comwas_id = int.Parse(this.txtsta_comwas_id.Text); int tra_number = int.Parse(this.txttra_number.Text); int tra_ID = int.Parse(this.lbltra_ID.Text); int tra_addressID = int.Parse(this.txttra_addressID.Text); string tra_type = this.txttra_type.Text; string tra_vaild = this.txttra_vaild.Text; int tra_sort = int.Parse(this.txttra_sort.Text); WalleProject.Model.t_tradingrecord model = new WalleProject.Model.t_tradingrecord(); model.tra_U_ID = tra_U_ID; model.tra_transactionAmount = tra_transactionAmount; model.tra_transactionDate = tra_transactionDate; model.tra_accomplish = tra_accomplish; model.tra_staff_id = tra_staff_id; model.sta_comwas_id = sta_comwas_id; model.tra_number = tra_number; model.tra_ID = tra_ID; model.tra_addressID = tra_addressID; model.tra_type = tra_type; model.tra_vaild = tra_vaild; model.tra_sort = tra_sort; WalleProject.BLL.t_tradingrecord bll = new WalleProject.BLL.t_tradingrecord(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { try { string strErr = ""; int number = int.Parse(txt_number.Value); int addressID; if (number <= 0 && number > int.Parse(lblcom_number.Text)) { strErr = "回收的数量不符合要求"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } if (r6.Checked) { addressID = int.Parse(lb_address.SelectedValue); } else { Model.t_address address = new Model.t_address(); address.add_province = ddl_p.Items[ddl_p.SelectedIndex].Text; address.add_city = ddl_c.Items[ddl_c.SelectedIndex].Text; address.add_counties = ddl_d.Items[ddl_d.SelectedIndex].Text; address.add_address = input_Address.Text; address.add_date = DateTime.Now; address.add_default = "0"; address.add_u_ID = int.Parse(userid.Text); address.add_postcode = 000000; address.add_contactName = input_userName.Text; address.add_contactPhone = input_phone.Text; address.add_ID = new BLL.t_address().GetMaxId(); bool istrue = new BLL.t_address().Add(address); addressID = address.add_ID; } user = new BLL.t_user().GetModel(int.Parse(userid.Text)); int tra_U_ID = int.Parse(userid.Text); decimal tra_transactionAmount = decimal.Parse(this.lblcom_conversionInt.Text); DateTime tra_transactionDate = DateTime.Now; string tra_accomplish = "发布"; int tra_staff_id = 0; int sta_comwas_id = int.Parse(this.lblcom_id.Text); int tra_number = int.Parse(this.txt_number.Value); if (user.u_integral < tra_number * tra_transactionAmount) { strErr += "你的积分不够哦!\\n"; MessageBox.Show(this, strErr); return; } user.u_integral = Convert.ToInt32(user.u_integral - tra_number * tra_transactionAmount); bool isuser = new BLL.t_user().Update(user); // int tra_addressID = int.Parse(this.rad_address.SelectedValue); string tra_type = "商品"; string tra_vaild = "是"; int tra_sort = 1; WalleProject.Model.t_tradingrecord model = new WalleProject.Model.t_tradingrecord(); model.tra_addressID = addressID; model.tra_U_ID = tra_U_ID; model.tra_transactionAmount = tra_transactionAmount; model.tra_transactionDate = tra_transactionDate; model.tra_accomplish = tra_accomplish; model.tra_staff_id = tra_staff_id; model.sta_comwas_id = sta_comwas_id; model.tra_number = tra_number; model.tra_type = tra_type; model.tra_vaild = tra_vaild; model.tra_sort = tra_sort; WalleProject.BLL.t_tradingrecord bll = new WalleProject.BLL.t_tradingrecord(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "发布成功,等待回收员接单", "CommodityView.aspx?id=9"); } catch (Exception ex) { MessageBox.Show(this, ex.Message); } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (int.Parse(txt_number.Value) <= 0) { strErr = "回收的数量不符合要求"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int number = int.Parse(txt_number.Value); int addressID; if (r6.Checked) { addressID = int.Parse(ListBox1.SelectedValue); } else { Model.t_address address = new Model.t_address(); address.add_province = ddl_p.Items[ddl_p.SelectedIndex].Text; address.add_city = ddl_c.Items[ddl_c.SelectedIndex].Text; address.add_counties = ddl_d.Items[ddl_d.SelectedIndex].Text; address.add_address = input_Address.Text; address.add_date = DateTime.Now; address.add_default = "0"; address.add_u_ID = int.Parse(userid.Text); address.add_postcode = 000000; address.add_contactName = input_userName.Text; address.add_contactPhone = input_phone.Text; address.add_ID = new BLL.t_address().GetMaxId(); bool istrue = new BLL.t_address().Add(address); addressID = address.add_ID; } int tra_U_ID = int.Parse(userid.Text); decimal tra_transactionAmount = decimal.Parse(this.lblwas_price2.Text); DateTime tra_transactionDate = DateTime.Now; string tra_accomplish = "发布"; int tra_staff_id = 0; int sta_comwas_id = int.Parse(this.lblwas_ID.Text); int tra_number = int.Parse(txt_number.Value); // int tra_addressID = int.Parse(this.rad_address.SelectedValue); string tra_type = "废品"; string tra_vaild = "是"; int tra_sort = 1; WalleProject.Model.t_tradingrecord model = new WalleProject.Model.t_tradingrecord(); model.tra_addressID = addressID; model.tra_U_ID = tra_U_ID; model.tra_transactionAmount = tra_transactionAmount; model.tra_transactionDate = tra_transactionDate; model.tra_accomplish = tra_accomplish; model.tra_staff_id = tra_staff_id; model.sta_comwas_id = sta_comwas_id; model.tra_number = tra_number; // model.tra_addressID = tra_addressID; model.tra_type = tra_type; model.tra_vaild = tra_vaild; model.tra_sort = tra_sort; WalleProject.BLL.t_tradingrecord bll = new WalleProject.BLL.t_tradingrecord(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "发布成功,等待回收员上门!", "WasteView.aspx?id=5"); }