protected void btnDelete_Click(object sender, EventArgs e) { string whcode = this.txtWHID.Text; string areacode = this.txtAreaID.Text; string shelfCode = this.txtShelfCode.Text; string shelfid = this.txtShelfID.Text; DataTable dtTemp = bll.FillDataTable("Cmd.SelectCell", new DataParameter[] { new DataParameter("{0}", "SHELF_CODE='" + shelfCode + "'") }); int count = dtTemp.Rows.Count; if (count > 0) { JScript.ShowMessage(this, shelfCode + "货架还有下属货位,不能删除!"); return; } else { bll.ExecNonQuery("Cmd.DeleteShelf", new DataParameter[] { new DataParameter("{0}", shelfid) }); this.txtShelfID.Text = ""; this.txtShelfCode.Text = ""; this.txtShelfName.Text = ""; this.txtMemo.Text = ""; this.btnSave.Enabled = true; string path = whcode + "/" + areacode + "/" + shelfCode; JScript.RegisterScript(this, "RefreshParent('" + path + "');"); } Common.AddOperateLog(Session["G_user"].ToString(), "货贺管理", "删除货贺信息"); }
protected void btnDelete_Click(object sender, EventArgs e) { string whcode = this.txtWhCode.Text; DataTable dtTemp = bll.FillDataTable("Cmd.SelectArea", new DataParameter[] { new DataParameter("{0}", "WarehouseCode='" + whcode + "'") }); int count = dtTemp.Rows.Count; if (count > 0) { JScript.ShowMessage(this, whcode + "还有下属库区,不能删除!"); return; } else { bll.ExecNonQuery("Cmd.DeleteWarehouse", new DataParameter[] { new DataParameter("{0}", whcode) }); this.txtWHID.Text = ""; this.txtWhName.Text = ""; this.txtMemo.Text = ""; this.txtWhCode.ReadOnly = false; string path = whcode; JScript.RegisterScript(this, "RefreshParent('" + path + "');"); } AddOperateLog("仓库管理", "删除仓库信息"); }
protected void btnSave_Click(object sender, EventArgs e) { if (this.txtWHID.Text.Trim().Length == 0)//新增 { int count = bll.GetRowCount("CMD_WAREHOUSE", string.Format("WarehouseCode='{0}'", this.txtWhCode.Text)); if (count > 0) { JScript.ShowMessage(this, "此仓库编码已存在,不能新增!"); return; } //新增 bll.ExecNonQuery("Cmd.InsertWarehouse", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWhCode.Text), new DataParameter("@WarehouseName", this.txtWhName.Text.Trim().Replace("\'", "\''")), new DataParameter("@MEMO", this.txtMemo.Text.Trim()) }); JScript.RegisterScript(this, "ReloadParent();"); AddOperateLog("仓库管理", "添加仓库信息"); } else { //更新 bll.ExecNonQuery("Cmd.UpdateWarehouse", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWhCode.Text), new DataParameter("@WarehouseName", this.txtWhName.Text.Trim().Replace("\'", "\''")), new DataParameter("@MEMO", this.txtMemo.Text.Trim()), new DataParameter("{0}", this.txtWhCode.Text) }); JScript.RegisterScript(this, "UpdateParent();"); AddOperateLog("仓库管理", "修改仓库信息"); } JScript.RegisterScript(this, "window.close();"); }
protected void btnDelete_Click(object sender, EventArgs e) { string whcode = this.txtWHID.Text; string areaCode = this.txtAreaCode.Text; string areaid = this.txtAreaID.Text; DataTable dtTemp = bll.FillDataTable("Cmd.SelectShelf", new DataParameter[] { new DataParameter("{0}", "AreaCode='" + areaid + "'") }); int count = dtTemp.Rows.Count; if (count > 0) { JScript.ShowMessage(this, areaCode + "库区还有下属货架,不能删除!"); return; } else { bll.ExecNonQuery("Cmd.DeleteArea", new DataParameter[] { new DataParameter("{0}", areaid) }); this.txtAreaID.Text = ""; this.txtAreaCode.Text = ""; this.txtAreaName.Text = ""; this.txtMemo.Text = ""; this.txtAreaCode.ReadOnly = false; string path = whcode + "/" + areaCode; JScript.RegisterScript(this, "RefreshParent('" + path + "');"); Common.AddOperateLog(Session["G_user"].ToString(), "库区管理", "删除库区信息"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (this.txtAreaID.Text.Trim().Length == 0)//新增 { int count = bll.GetRowCount(TableName, string.Format("AreaCode='{0}'", this.txtAreaCode.Text)); if (count > 0) { JScript.ShowMessage(this, "此库区编码已存在,不能新增!"); return; } bll.ExecNonQuery("Cmd.InsertArea", new DataParameter[] { new DataParameter("@AreaCode", this.txtAreaCode.Text), new DataParameter("@AreaName", this.txtAreaName.Text.Trim().Replace("\'", "\''")), new DataParameter("@WarehouseCode", this.txtWHID.Text), new DataParameter("@Memo", this.txtMemo.Text.Trim()) }); JScript.RegisterScript(this, "ReloadParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "库区管理", "添加库区信息"); } else { bll.ExecNonQuery("Cmd.UpdateArea", new DataParameter[] { new DataParameter("@AreaCode", this.txtAreaCode.Text), new DataParameter("@AreaName", this.txtAreaName.Text.Trim().Replace("\'", "\''")), new DataParameter("@MEMO", this.txtMemo.Text.Trim()), new DataParameter("{0}", this.txtAreaID.Text) }); JScript.RegisterScript(this, "UpdateParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "库区管理", "修改库区信息"); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (this.txtShelfID.Text.Trim().Length == 0) { int count = bll.GetRowCount("CMD_WH_SHELF", string.Format("ShelfCode='{0}'", this.txtShelfCode.Text)); if (count > 0) { JScript.ShowMessage(this, "此货架编码已存在,不能新增!"); return; } bll.ExecNonQuery("Cmd.InsertShelf", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWHID.Text), new DataParameter("@AreaCode", this.txtAreaID.Text.Trim()), new DataParameter("@ShelfCode", this.txtShelfCode.Text), new DataParameter("@ShelfName", this.txtShelfName.Text.Trim()), new DataParameter("@Rows", this.txtCellRows.Text), new DataParameter("@Columns", this.txtCellCols.Text.Trim()), new DataParameter("@IsActive", this.ddlActive.SelectedValue), new DataParameter("@Memo", this.txtMemo.Text.Trim()) }); //this.btnContinue.Enabled = true; //this.btnSave.Enabled = false; JScript.RegisterScript(this, "ReloadParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "货贺管理", "添加货贺信息"); } else { bll.ExecNonQuery("Cmd.UpdateShelf", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWHID.Text), new DataParameter("@AreaCode", this.txtAreaID.Text.Trim()), new DataParameter("@ShelfName", this.txtShelfName.Text.Trim()), new DataParameter("@Rows", this.txtCellRows.Text), new DataParameter("@Columns", this.txtCellCols.Text.Trim()), new DataParameter("@IsActive", this.ddlActive.SelectedValue), new DataParameter("@Memo", this.txtMemo.Text.Trim()), new DataParameter("@ShelfCode", this.txtShelfCode.Text), new DataParameter("{0}", this.txtShelfID.Text) }); JScript.RegisterScript(this, "UpdateParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "货贺管理", "修改货贺信息"); } } catch (Exception exp) { JScript.ShowMessage(this, exp.Message); } //JScript.RegisterScript(this, "window.close();"); }
protected void btnDelete_Click(object sender, EventArgs e) { dtCell = bll.FillDataTable("Cmd.SelectCell", new DataParameter[] { new DataParameter("{0}", "CMD_CELL_ID='" + txtCELLID.Text + "'") }); if (dtCell.Rows[0]["QUANTITY"].ToString() != "") { decimal qty = Convert.ToDecimal(dtCell.Rows[0]["QUANTITY"].ToString()); if (qty > 0) { JScript.ShowMessage(this, "该货位正在使用,不能删除!"); return; } } string whcode = dtCell.Rows[0]["WAREHOUSE_CODE"].ToString(); string areacode = dtCell.Rows[0]["AREA_CODE"].ToString(); string shelfCode = dtCell.Rows[0]["SHELF_CODE"].ToString(); string cellcode = dtCell.Rows[0]["CELL_CODE"].ToString(); string cellid = this.txtCELLID.Text; dtCell = bll.FillDataTable("Cmd.DeleteCell", new DataParameter[] { new DataParameter("{0}", this.txtCELLID.Text) }); this.txtCELLID.Text = ""; this.txtCellCode.Text = ""; this.txtCellName.Text = ""; this.ddlActive.SelectedIndex = 0; this.txtAreaID.Text = ""; this.btnSave.Enabled = true; string path = whcode + "/" + areacode + "/" + shelfCode + "/" + cellcode; JScript.RegisterScript(this, "RefreshParent('" + path + "');"); Common.AddOperateLog(Session["G_user"].ToString(), "货位管理", "删除货位信息"); }
protected void btnCancel_Click(object sender, EventArgs e) { JScript.RegisterScript(this, "window.close();"); }
protected void btnSave_Click(object sender, EventArgs e) { try { if (this.txtCELLID.Text.Trim().Length == 0)//新增 { int count = bll.GetRowCount("CMD_WH_CELL", string.Format("CellCode='{0}'", this.txtCellCode.Text)); if (count > 0) { JScript.ShowMessage(this, "此货位编码已存在,不能新增!"); return; } string comds = "Cmd.InsertCell"; DataParameter[] paras = new DataParameter[] { new DataParameter("@CellCode", this.txtCellCode.Text), new DataParameter("@CellName", this.txtCellName.Text.Trim().Replace("\'", "\''")), new DataParameter("@AreaCode", this.txtAreaID.Text), new DataParameter("@ShelfCode", this.txtShelfID.Text.Trim()), new DataParameter("@CellRow", this.txtCellRows.Text), new DataParameter("@CellColumn", this.txtCellCols.Text.Trim()), new DataParameter("@IsActive", this.ddlActive.SelectedValue), new DataParameter("@IsLock", this.ddlLock.SelectedValue), new DataParameter("@Memo", this.txtMemo.Text) }; bll.ExecNonQuery(comds, paras); this.btnSave.Enabled = false; JScript.RegisterScript(this, "ReloadParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "货位管理", "添加货位信息"); } else//修改 { string strWhere = ""; if (this.rpt1.Checked) { strWhere = string.Format("CellCode='{0}'", this.txtCELLID.Text); } else if (this.rpt2.Checked) { strWhere = string.Format("CellRow={0} and AreaCode='{1}' and ShelfCode='{2}' and ProductCode not in ('0001','0002')", this.txtCellRows.Text, this.txtAreaID.Text, this.txtShelfID.Text); int count = bll.GetRowCount("Cmd_Cell", string.Format("CellRow={0} and AreaCode='{1}' and ShelfCode='{2}' and ProductCode not in ('0001','0002') and ProductCode!=''", this.txtCellRows.Text, this.txtAreaID.Text, this.txtShelfID.Text)); if (count > 0) { JScript.ShowMessage(this, "货位所在货架层的所有货位中有存放产品的货位,无法整层修改!"); return; } } else { strWhere = string.Format("CellColumn={0} and AreaCode='{1}' and ShelfCode='{2}' and ProductCode not in ('0001','0002')", this.txtCellCols.Text, this.txtAreaID.Text, this.txtShelfID.Text); int count = bll.GetRowCount("Cmd_Cell", string.Format("CellColumn={0} and AreaCode='{1}' and ShelfCode='{2}' and ProductCode not in ('0001','0002') and ProductCode!=''", this.txtCellCols.Text, this.txtAreaID.Text, this.txtShelfID.Text)); if (count > 0) { JScript.ShowMessage(this, "货位所在货架列的所有货位中有存放产品的货位,无法整列修改!"); return; } } bll.ExecNonQuery("Cmd.UpdateCell", new DataParameter[] { new DataParameter("@AreaCode", this.ddlAreaCode.SelectedValue), new DataParameter("@IsActive", this.ddlActive.SelectedValue), new DataParameter("@MEMO", this.txtMemo.Text), new DataParameter("{0}", strWhere) }); JScript.RegisterScript(this, "UpdateParent();"); Common.AddOperateLog(Session["G_user"].ToString(), "货位管理", "修改货位信息"); } } catch (Exception exp) { JScript.ShowMessage(this, exp.Message); } }