private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreModeId = int.Parse(ddlStoreMode.SelectedValue); model.HandlingModeId = int.Parse(ddlHandlingMode.SelectedValue); model.UnitId = int.Parse(ddlUnit.SelectedValue); model.Name = txtName.Text; string[] attributeNames = Request.Form.GetValues("AttributeName"); string[] attributeValues = Request.Form.GetValues("AttributeValue"); string[] attributeRemarks = Request.Form.GetValues("AttributeRemark"); if (attributeNames != null && attributeValues != null && attributeRemarks != null && attributeNames.Length > 0 && attributeValues.Length > 0 && attributeRemarks.Length > 0) { for (int i = 0; i < attributeNames.Length; i++) { model.AddAttributeValues(new GoodsAttributeValues(attributeNames[i], attributeValues[i], attributeRemarks[i])); } } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return(result); }
/// <summary> /// 修改类型 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { Model.Goods modl = new Model.Goods(); Model.cost_type models = new Model.cost_type(); string types = (Request.QueryString["type"].ToString()); bool result; if (types == "0") { modl.Goods_name = txt_name.Value; modl.id = Convert.ToInt32(Request.QueryString["id"].ToString()); modl.Goods_number = fmshif.GetModel(Convert.ToInt32(Request.QueryString["id"].ToString())).Goods_number; modl.Goods_ifType = 0; result = fmshif.Update(modl); } else { models.ct_name = txt_name.Value; models.id = Convert.ToInt32(Request.QueryString["id"].ToString()); models.ct_iftype = 0; models.ct_number = fmcost.GetModel(Convert.ToInt32(Request.QueryString["id"].ToString())).ct_number; result = fmcost.Update(models); } if (result) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('修改成功!');parent.Window_Close();</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('修改失败!');</script>"); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { string id = Request.QueryString["id"].ToString(); Model.Goods frmtype = new Model.Goods(); frmtype.Goods_number = txtBH.Value; frmtype.Goods_name = txtName.Value; frmtype.Goods_ifType = 1; frmtype.Goods_unit = txt_unit.Value; if (txt_Jf.Value == "") { frmtype.Goods_jf = 0; } else { frmtype.Goods_jf = Convert.ToInt32(txt_Jf.Value); } frmtype.Goods_categories = Convert.ToInt32(DDlfylb.SelectedValue); frmtype.Goods_price = Convert.ToDecimal(txtPrice.Value); if (radStatu.Checked == true) { frmtype.Goods_state = radStatu.Value; } else { frmtype.Goods_state = radStatus.Value; } // frmtype.Goods_categories = Convert.ToInt32(DDlfylb.SelectedValue); if (id == "") { int Result = fmcost.Add(frmtype); if (Result > 0) { //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", ""); ScriptManager.RegisterStartupScript(this, this.GetType(), "click", "alert('保存成功');parent.Window_Close();", true); } } else { frmtype.id = Convert.ToInt32(id); if (fmcost.Update(frmtype)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "click", "alert('更新成功');parent.Window_Close();", true); } } }
private void btConfirm_Click(object sender, EventArgs e) { if (tbID.Text.Trim() == "" || tbRoomType.Text.Trim() == "") { MessageBox.Show("输入信息不完整!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); flag = 1; } if (flag == 0) { if (tbRoomType.Text.Trim() == "双人间" || tbRoomType.Text.Trim() == "单人间" || tbRoomType.Text.Trim() == "套房") { Maticsoft.BLL.Goods go = new BLL.Goods(); string str1 = string.Format("goodsID = '{0}'", tbID.Text.Trim()); Model.Goods gmodel = new Model.Goods(); if (go.GetRecordCount(str1) > 0) { gmodel.goodsID = tbID.Text.Trim(); gmodel.goodsName = tbName.Text.Trim(); gmodel.goodsPrice = Convert.ToDecimal(tbPrice.Text.Trim()); gmodel.roomTypeID = tbRoomType.Text.Trim(); if (go.Update(gmodel) == true) { MessageBox.Show("修改成功!"); ((Main_Admin)this.Owner).RoomGoodsLoad(); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("修改失败!"); } } else { MessageBox.Show("不存在此物品编号!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("房型不存在!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return(result); }
/// <summary> /// 费用大类录入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { //string id = ""; Model.Goods frmfysz = new Model.Goods(); frmfysz.Goods_name = txt_name.Value; string MaxNumber = fmcost.GetMaxNumber(" where Goods_ifType=0").ToString().Trim(); if (MaxNumber == "1") { frmfysz.Goods_number = "0001"; } else { frmfysz.Goods_number = "000" + (Convert.ToInt32(MaxNumber) + 1); } frmfysz.Goods_ifType = 0; if (ids == "") { int Result = fmcost.Add(frmfysz); if (Result > 0) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.Window_Close();</script>"); // alert('保存成功');parent.document.getElementById('btnsercher').click();parent.Window_Close(); Bind(); BindGv(pageSize, pageIndex); } } else { frmfysz.id = Convert.ToInt32(ids); if (fmcost.Update(frmfysz)) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('更新成功');parent.Window_Close();</script>"); } } }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreModeId = int.Parse(ddlStoreMode.SelectedValue); model.HandlingModeId = int.Parse(ddlHandlingMode.SelectedValue); model.UnitId = int.Parse(ddlUnit.SelectedValue); model.Name = txtName.Text; string[] attributeNames = Request.Form.GetValues("AttributeName"); string[] attributeValues = Request.Form.GetValues("AttributeValue"); string[] attributeRemarks = Request.Form.GetValues("AttributeRemark"); if (attributeNames != null && attributeValues != null && attributeRemarks != null && attributeNames.Length > 0 && attributeValues.Length > 0 && attributeRemarks.Length > 0) { for (int i = 0; i < attributeNames.Length; i++) { model.AddAttributeValues(new GoodsAttributeValues(attributeNames[i], attributeValues[i], attributeRemarks[i])); } } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); model.Variety = txtVariety.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return result; }