コード例 #1
0
ファイル: InventoryView.aspx.cs プロジェクト: qq5013/CL_WMCS
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string strID = this.txtID.Text;
        int    Count = bll.GetRowCount("VUsed_WMS_BillMaster", string.Format("BillID='{0}'", this.txtID.Text.Trim()));

        if (Count > 0)
        {
            JScript.Instance.ShowMessage(this.updatePanel, "该盘点单号已被其它单据使用,请调整后再删除!");
            return;
        }

        string[] comds = new string[2];
        comds[0] = "WMS.DeleteBillMaster";
        comds[1] = "WMS.DeleteBillDetail";
        List <DataParameter[]> paras = new List <DataParameter[]>();

        paras.Add(new DataParameter[] { new DataParameter("{0}", "'" + strID + "'") });
        paras.Add(new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", strID)) });
        bll.ExecTran(comds, paras);

        AddOperateLog("盘库单", "删除单号:" + strID);

        btnNext_Click(sender, e);
        if (this.txtID.Text == strID)
        {
            btnPre_Click(sender, e);
            if (this.txtID.Text == strID)
            {
                BindDataNull();
            }
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDropDownList();
            if (Request.QueryString["CMD_CELL_ID"] != null)
            {
                dtCell = bll.FillDataTable("Cmd.SelectCell", new DataParameter[] { new DataParameter("{0}", "CellCode='" + Request.QueryString["CMD_CELL_ID"] + "'") });
                this.txtCELLID.Text  = dtCell.Rows[0]["CellCode"].ToString();
                this.txtShelfID.Text = dtCell.Rows[0]["ShelfCode"].ToString();
                this.txtAreaID.Text  = dtCell.Rows[0]["AreaCode"].ToString();

                this.txtShelfName.Text    = bll.GetFieldValue("CMD_Shelf", "ShelfName", "ShelfCode='" + this.txtShelfID.Text + "'");
                ddlAreaCode.SelectedValue = this.txtAreaID.Text;

                this.txtCellCode.Text        = dtCell.Rows[0]["CellCode"].ToString();
                this.txtCellName.Text        = dtCell.Rows[0]["CellName"].ToString();
                this.ddlActive.SelectedValue = dtCell.Rows[0]["IsActive"].ToString();

                this.txtCellRows.Text      = dtCell.Rows[0]["CellRow"].ToString();
                this.txtCellCols.Text      = dtCell.Rows[0]["CellColumn"].ToString();
                this.ddlLock.SelectedValue = dtCell.Rows[0]["IsLock"].ToString();

                this.txtMemo.Text = dtCell.Rows[0]["MEMO"].ToString();


                int count = bll.GetRowCount("View_CMD_CELL_ALL", "CellCode='" + this.txtCELLID.Text + "' and PalletCode!=''");
                if (count > 0)
                {
                    this.btnSave.Enabled = false;
                }
            }
            else if (Request.QueryString["SHELFCODE"] != null)
            {
                this.txtShelfID.Text = Request.QueryString["SHELFCODE"];
                this.txtAreaID.Text  = bll.GetFieldValue("CMD_Shelf", "AreaCode", "ShelfCode='" + this.txtShelfID.Text + "'");

                this.txtShelfName.Text         = bll.GetFieldValue("CMD_Shelf", "ShelfName", "ShelfCode='" + this.txtShelfID.Text + "'");
                this.ddlAreaCode.SelectedValue = this.txtAreaID.Text;

                int RowCount = bll.GetRowCount("CMD_WH_CELL", string.Format("SHELF_CODE='{0}'", Request.QueryString["SHELFCODE"])) + 1;
                this.txtCellCode.Text = Request.QueryString["SHELFCODE"] + RowCount.ToString().PadLeft(3, '0');
                this.txtCellCols.Text = RowCount.ToString();
                this.txtCELLID.Text   = "";
                //this.txtEGroup.Text = "0";
                //this.txtECom.Text = "0";
                //this.txtEAddress.Text = "0";
            }
            SetTextReadOnly(this.txtCellName, this.txtCellCode, this.txtShelfName, this.txtCellCols, this.txtCellRows);
        }
        else
        {
        }
    }
コード例 #3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_BillType", string.Format("BillTypeCode='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.Instance.ShowMessage(this.Page, "该类型编码已经存在!");
                return;
            }

            bll.ExecNonQuery("Cmd.InsertBillType", new DataParameter[] {
                new DataParameter("@BillTypeCode", this.txtID.Text.Trim()),
                new DataParameter("@BillTypeName", this.txtBillTypeName.Text.Trim()),
                new DataParameter("@Flag", "1"),
                new DataParameter("@TaskType", "11"),
                new DataParameter("@TaskLevel", 1),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString())
            });
        }
        else //修改
        {
            bll.ExecNonQuery("Cmd.UpdateBillType", new DataParameter[] { new DataParameter("@BillTypeName", this.txtBillTypeName.Text.Trim()),
                                                                         new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                                                                         new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                                                                         new DataParameter("@BillTypeCode", this.txtID.Text.Trim()) });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #4
0
ファイル: WarehouseEditPage.aspx.cs プロジェクト: qq5013/ROBO
    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();");
    }
コード例 #5
0
    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.Instance.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.Instance.RegisterScript(this, "ReloadParent();");
            AddOperateLog("库区管理", "添加库区信息");
        }
        else
        {
            bll.ExecNonQuery("Cmd.UpdateArea", new DataParameter[] {
                new DataParameter("@AreaName", this.txtAreaName.Text.Trim().Replace("\'", "\''")),
                new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                new DataParameter("{0}", this.txtAreaID.Text)
            });


            JScript.Instance.RegisterScript(this, "UpdateParent();");
            AddOperateLog("库区管理", "修改库区信息");
        }
    }
コード例 #6
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";

        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_CMD_Product", string.Format("ProductCode='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "车型信息被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";


        bll.ExecNonQuery("Cmd.DeleteProduct", new DataParameter[] { new DataParameter("{0}", strColorCode) });
        AddOperateLog("产品信息", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
    }
コード例 #7
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";
        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_CMD_BillType", string.Format("BillTypeCode='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "入库类型被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";

        bll.ExecNonQuery("Cmd.DeleteBillType", new DataParameter[] { new DataParameter("{0}", strColorCode) });
        AddOperateLog("入库类型", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
    }
コード例 #8
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        string start = "1900-01-01";
        string end   = System.DateTime.Now.AddDays(1).ToString();

        try
        {
            if (this.txtStartDate.tDate.Text.Trim().Length > 0)
            {
                start = Convert.ToDateTime(this.txtStartDate.tDate.Text.Trim()).ToString();
            }
            if (this.txtEndDate.tDate.Text.Trim().Length > 0)
            {
                end = Convert.ToDateTime(this.txtEndDate.tDate.Text.Trim()).AddDays(1).ToString();
            }


            filter = string.Format("{0} like '{1}%' and (CatchTime>='{2}' and CatchTime<'{3}')", this.ddl_Field.SelectedValue, this.txtKeyWords.Text.Trim().Replace("'", ""), start, end);
            ViewState["filter"] = filter;


            totalCount = bll.GetRowCount(TableName, filter);
            pageIndex  = 1;
            SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, gvMain, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
        }
        catch (Exception ex)
        {
            JScript.Instance.ShowMessage(this.UpdatePanel1, ex.Message);
            return;
        }
    }
コード例 #9
0
ファイル: ProductStateEdit.aspx.cs プロジェクト: qq5013/ROBO
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_ProductState", string.Format("StateNo='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.ShowMessage(this.Page, "该状态编码已经存在!");
                return;
            }

            bll.ExecNonQuery("Cmd.InsertProductState", new DataParameter[] { new DataParameter("@StateNo", this.txtID.Text.Trim()),
                                                                             new DataParameter("@StateName", this.txtStateName.Text.Trim()),

                                                                             new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                                                                             new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                                                                             new DataParameter("@Updater", Session["EmployeeCode"].ToString()) });
        }
        else //修改
        {
            bll.ExecNonQuery("Cmd.UpdateProductState", new DataParameter[] { new DataParameter("@StateName", this.txtStateName.Text.Trim()),

                                                                             new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                                                                             new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                                                                             new DataParameter("{0}", this.txtID.Text.Trim()) });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #10
0
ファイル: CarEdit.aspx.cs プロジェクト: qq5013/CL_WMCS
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_Car", string.Format("CarNo='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.Instance.ShowMessage(this.Page, "该小车编码已经存在!");
                return;
            }

            bll.ExecNonQuery("Cmd.InsertCar", new DataParameter[] {
                new DataParameter("@CarNo", this.txtID.Text.Trim()),
                new DataParameter("@CarName", this.txtTypeName.Text.Trim()),
                new DataParameter("@State", this.ddlActive.SelectedValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim())
            });
        }
        else //修改
        {
            bll.ExecNonQuery("Cmd.UpdateCar", new DataParameter[] { new DataParameter("@CarName", this.txtTypeName.Text.Trim()),
                                                                    new DataParameter("@State", this.ddlActive.SelectedValue),
                                                                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),

                                                                    new DataParameter("@CarNo", this.txtID.Text.Trim()) });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #11
0
ファイル: InStockEdit.aspx.cs プロジェクト: qq5013/ROBO
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateTempSub(this.dgViewSub1);
        string[]        Commands = new string[3];
        DataParameter[] para;

        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("WMS_BillMaster", string.Format("BillID='{0}'", this.txtID.Text.Trim()));
            if (Count > 0)
            {
                JScript.ShowMessage(this.updatePanel1, "该入库单已经存在!");
                return;
            }
            para = new DataParameter[] {
                new DataParameter("@BillID", this.txtID.Text.Trim()),
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@BillTypeCode", this.ddlBillTypeCode.SelectedValue),
                new DataParameter("@AreaCode", ""),
                new DataParameter("@FactoryID", this.ddlFactoryID.SelectedValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@BatchNo", this.txtBatchNo.Text.Trim()),
                new DataParameter("@SourceBillNo", this.txtSourceBillNo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString())
            };
            Commands[0] = "WMS.InsertInStockBill";
        }
        else //修改
        {
            para = new DataParameter[] {
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@BillTypeCode", this.ddlBillTypeCode.SelectedValue),
                new DataParameter("@AreaCode", ""),
                new DataParameter("@FactoryID", this.ddlFactoryID.SelectedValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@BatchNo", this.txtBatchNo.Text.Trim()),
                new DataParameter("@SourceBillNo", this.txtSourceBillNo.Text.Trim()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("{0}", string.Format("BillID='{0}'", this.txtID.Text.Trim()))
            };
            Commands[0] = "WMS.UpdateInStock";
        }
        try
        {
            DataTable dt = (DataTable)ViewState[FormID + "_Edit_dgViewSub1"];
            Commands[1] = "WMS.DeleteBillDetail";
            Commands[2] = "WMS.InsertInStockDetail";
            bll.ExecTran(Commands, para, "BillID", new DataTable[] { dt });
        }
        catch (Exception ex)
        {
            JScript.ShowMessage(this.updatePanel1, ex.Message);
            return;
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["CMD_WH_SHELF_ID"] != null)
            {
                dtShelf = bll.FillDataTable("Cmd.SelectCellShelf", new DataParameter[] { new DataParameter("{0}", " ShelfCode='" + Request.QueryString["CMD_WH_SHELF_ID"] + "'") });

                this.txtShelfID.Text = dtShelf.Rows[0]["ShelfCode"].ToString();

                this.txtWHID.Text   = dtShelf.Rows[0]["WarehouseCode"].ToString();
                this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'");
                this.txtAreaID.Text = dtShelf.Rows[0]["AreaCode"].ToString();

                this.txtShelfCode.Text = dtShelf.Rows[0]["ShelfCode"].ToString();
                this.txtShelfName.Text = dtShelf.Rows[0]["ShelfName"].ToString();
                this.txtCellRows.Text  = dtShelf.Rows[0]["Rows"].ToString();
                this.txtCellCols.Text  = dtShelf.Rows[0]["Columns"].ToString();

                this.txtMemo.Text            = dtShelf.Rows[0]["MEMO"].ToString();
                this.ddlActive.SelectedValue = dtShelf.Rows[0]["IsActive"].ToString();
            }
            else if (Request.QueryString["AREACODE"] != null)
            {
                this.txtAreaID.Text = Request.QueryString["AREACODE"];
                this.txtWHID.Text   = bll.GetFieldValue("CMD_Area", "WarehouseCode", "AreaCode='" + this.txtAreaID.Text + "'");
                this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'");

                this.txtShelfID.Text = "";

                int RowCount = bll.GetRowCount("CMD_WH_SHELF", string.Format("AREA_CODE='{0}'", Request.QueryString["AREACODE"])) + 1;
                this.txtShelfCode.Text = Request.QueryString["AREACODE"] + RowCount.ToString().PadLeft(3, '0');
            }
            SetTextReadOnly(txtShelfCode, this.txtWhName, this.txtCellCols, this.txtCellRows);
        }
    }
コード例 #13
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";

        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_WMS_BillMaster", string.Format("BillID='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.ShowMessage(this.UpdatePanel1, hk.Text + "移库单号被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";


        string[] comds = new string[2];
        comds[0] = "WMS.DeleteBillMaster";
        comds[1] = "WMS.DeleteBillDetail";
        List <DataParameter[]> paras = new List <DataParameter[]>();

        paras.Add(new DataParameter[] { new DataParameter("{0}", strColorCode) });
        paras.Add(new DataParameter[] { new DataParameter("{0}", string.Format("BillID in ({0})", strColorCode)) });
        bll.ExecTran(comds, paras);

        AddOperateLog("移库单", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        this.hdnRowIndex.Value = "0";
        dvscrollX.Value        = "0";
        dvscrollY.Value        = "0";

        DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);

        SetBindDataSub(dt);
    }
コード例 #14
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_ProductCategory", string.Format("CategoryCode='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.Instance.ShowMessage(this.Page, "该类别编码已经存在!");
                return;
            }

            bll.ExecNonQuery("Cmd.InsertProductCategory", new DataParameter[] {
                new DataParameter("@CategoryCode", this.txtID.Text.Trim()),
                new DataParameter("@CategoryName", this.txtProductTypeName.Text.Trim()),
                new DataParameter("@WarehouseCode", ""),
                new DataParameter("@AreaCode", ""),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString())
            });
        }
        else //修改
        {
            string Comd = "Cmd.UpdateProductCategory";



            DataParameter[] paras = new DataParameter[] { new DataParameter("@CategoryName", this.txtProductTypeName.Text.Trim()),
                                                          new DataParameter("@WarehouseCode", ""),
                                                          new DataParameter("@AreaCode", ""),
                                                          new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                                                          new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                                                          new DataParameter("@CategoryCode", this.txtID.Text.Trim()) };


            bll.ExecNonQuery(Comd, paras);
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #15
0
ファイル: Inventorys.aspx.cs プロジェクト: haipingma/CL_WMCS
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";
        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_WMS_BillMaster", string.Format("BillID='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, hk.Text + "移库单号被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";

        string[] comds = new string[2];
        comds[0] = "WMS.DeleteBillMaster";
        comds[1] = "WMS.DeleteBillDetail";
        List<DataParameter[]> paras = new List<DataParameter[]>();
        paras.Add(new DataParameter[] { new DataParameter("{0}", strColorCode) });
        paras.Add(new DataParameter[] { new DataParameter("{0}", string.Format("BillID in ({0})", strColorCode)) });
        bll.ExecTran(comds, paras);

        AddOperateLog("移库单", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        this.hdnRowIndex.Value = "0";
        dvscrollX.Value = "0";
        dvscrollY.Value = "0";

        DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
        SetBindDataSub(dt);
    }
コード例 #16
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string strID = this.txtID.Text;
        int    Count = bll.GetRowCount("VUsed_CMD_BillType", string.Format("BillTypeCode='{0}'", this.txtID.Text.Trim()));

        if (Count > 0)
        {
            JScript.Instance.ShowMessage(this.updatePanel, "该类型编码已被其它单据使用,请调整后再删除!");
            return;
        }
        bll.ExecNonQuery("Cmd.DeleteBillType", new DataParameter[] { new DataParameter("{0}", "'" + strID + "'") });
        AddOperateLog("入库类型", "删除单号:" + strID);

        btnNext_Click(sender, e);
        if (this.txtID.Text == strID)
        {
            btnPre_Click(sender, e);
            if (this.txtID.Text == strID)
            {
                BindDataNull();
            }
        }
    }
コード例 #17
0
ファイル: FactoryEdit.aspx.cs プロジェクト: qq5013/ROBO
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_Factory", string.Format("FactoryID='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.ShowMessage(this.Page, "该厂家编码已经存在!");
                return;
            }

            bll.ExecNonQuery("Cmd.InsertFactory", new DataParameter[] { new DataParameter("@FactoryID", this.txtID.Text.Trim()),
                                                                        new DataParameter("@FactoryName", this.txtFactoryName.Text.Trim()),
                                                                        new DataParameter("@Flag", 1),
                                                                        new DataParameter("@LinkPerson", this.txtLinkPerson.Text.Trim()),
                                                                        new DataParameter("@LinkPhone", this.txtLinkPhone.Text.Trim()),
                                                                        new DataParameter("@Fax", this.txtFax.Text.Trim()),
                                                                        new DataParameter("@Address", this.txtAddress.Text.Trim()),
                                                                        new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                                                                        new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                                                                        new DataParameter("@Updater", Session["EmployeeCode"].ToString()) });
        }
        else //修改
        {
            bll.ExecNonQuery("Cmd.UpdateFactory", new DataParameter[] { new DataParameter("@FactoryName", this.txtFactoryName.Text.Trim()),
                                                                        new DataParameter("@Flag", 1),
                                                                        new DataParameter("@LinkPerson", this.txtLinkPerson.Text.Trim()),
                                                                        new DataParameter("@LinkPhone", this.txtLinkPhone.Text.Trim()),
                                                                        new DataParameter("@Fax", this.txtFax.Text.Trim()),
                                                                        new DataParameter("@Address", this.txtAddress.Text.Trim()),
                                                                        new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                                                                        new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                                                                        new DataParameter("{0}", this.txtID.Text.Trim()) });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #18
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateTempSub(this.dgViewSub1);
        string[]        Commands = new string[3];
        DataParameter[] para;

        //判断库存
        DataTable dt        = (DataTable)ViewState[FormID + "_Edit_dgViewSub1"];
        DataTable dtProduct = dt.DefaultView.ToTable("Product", true, new string[] { "ProductCode", "ProductName" });

        for (int i = 0; i < dtProduct.Rows.Count; i++)
        {
            object o = dt.Compute("Count(ProductCode)", string.Format("ProductCode='{0}'", dtProduct.Rows[i]["ProductCode"]));
            if (o != null)
            {
                int Qty = int.Parse(o.ToString());
                if (Qty > 1)
                {
                    string Message = dtProduct.Rows[i]["ProductName"].ToString() + " 重复,请重新修改后保存!";

                    JScript.ShowMessage(this.updatePanel1, Message);
                    return;
                }
            }



            o = dt.Compute("Sum(Quantity)", string.Format("ProductCode='{0}'", dtProduct.Rows[i]["ProductCode"]));
            if (o != null)
            {
                int       Qty          = int.Parse(o.ToString());
                DataTable dtProductQty = bll.FillDataTable("WMS.SelectProductQty", new DataParameter[] { new DataParameter("@BillID", this.txtID.Text), new DataParameter("@ProductCode", dtProduct.Rows[i]["ProductCode"].ToString()) });
                int       StockQty     = 0;
                bool      blnvalue     = false;
                if (dtProductQty.Rows.Count == 0)
                {
                    blnvalue = true;
                }
                else
                {
                    StockQty = int.Parse(dtProductQty.Rows[0]["StockQty"].ToString());
                    if (Qty > StockQty)
                    {
                        blnvalue = true;
                    }
                }
                if (blnvalue)
                {
                    JScript.ShowMessage(this.updatePanel1, dtProduct.Rows[i]["ProductName"].ToString() + "现有库存数量为:" + StockQty.ToString() + ", 库存不足,请修改出库数量。");
                    return;
                }
            }
        }
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("WMS_BillMaster", string.Format("BillID='{0}'", this.txtID.Text.Trim()));
            if (Count > 0)
            {
                JScript.ShowMessage(this.updatePanel1, "该出库单已经存在!");
                return;
            }
            para = new DataParameter[] {
                new DataParameter("@BillID", this.txtID.Text.Trim()),
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@BillTypeCode", this.ddlBillTypeCode.SelectedValue),
                new DataParameter("@AreaCode", ""),
                new DataParameter("@SourceBillNo", this.txtSourceBillNo.Text),
                new DataParameter("@BatchNo", this.txtBatchNo.Text),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString())
            };
            Commands[0] = "WMS.InsertOutStockBill";
        }
        else //修改
        {
            para = new DataParameter[] {
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@BillTypeCode", this.ddlBillTypeCode.SelectedValue),
                new DataParameter("@AreaCode", ""),
                new DataParameter("@SourceBillNo", this.txtSourceBillNo.Text),
                new DataParameter("@BatchNo", this.txtBatchNo.Text),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("{0}", string.Format("BillID='{0}'", this.txtID.Text.Trim()))
            };
            Commands[0] = "WMS.UpdateOutStock";
        }
        try
        {
            Commands[1] = "WMS.DeleteBillDetail";
            Commands[2] = "WMS.InsertOutStockDetail";
            bll.ExecTran(Commands, para, "BillID", new DataTable[] { dt });
        }
        catch (Exception ex)
        {
            JScript.ShowMessage(this.updatePanel1, ex.Message);
            return;
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #19
0
ファイル: Server.cs プロジェクト: baoyigang/ZKSA
        /// <summary>
        /// 中間數據庫插入WCS數據庫,并轉入WCS_Task
        /// </summary>
        /// <param name="dt"></param>
        internal static void InsertTaskToWcs(DataTable dt, bool blnUpdateAck)
        {
            lock (Locker1)
            {
                try
                {
                    BLL.BLLBase bllStock  = new BLLBase("StockDB");
                    bool        blnCheck  = true;
                    string      SubTaskID = "";
                    //判斷中間表貨位是否正常
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        DataRow dr = dt.Rows[i];
                        if (dr["from_location_id"].ToString().Trim().Length == 6)
                        {
                            if (bllStock.GetRowCount("CMD_CEll", string.Format("AreaCode='{0}' and CellName='{1}'", dr["equipment"].ToString(), dr["from_location_id"].ToString())) == 0)
                            {
                                MCP.Logger.Error("WMS明細ID:" + dr["subtask_id"].ToString() + "分配貨位出錯!庫區" + dr["equipment"].ToString() + "不存在貨位:" + dr["from_location_id"].ToString());
                                blnCheck = false;
                                break;
                            }
                        }
                        if (dr["to_location_id"].ToString().Trim().Length == 6)
                        {
                            if (bllStock.GetRowCount("CMD_CEll", string.Format("AreaCode='{0}' and CellName='{1}'", dr["equipment"].ToString(), dr["to_location_id"].ToString())) == 0)
                            {
                                MCP.Logger.Error("WMS明細ID:" + dr["subtask_id"].ToString() + "分配貨位出錯!庫區" + dr["equipment"].ToString() + "不存在貨位:" + dr["to_location_id"].ToString());
                                blnCheck = false;
                                break;
                            }
                        }
                        SubTaskID = dr["subtask_id"].ToString() + ",";
                    }
                    if (!blnCheck)
                    {
                        return;
                    }


                    //删除现有数据,避免重复
                    bllStock.ExecNonQuery("WCS.DeleteAsrsTaskTMP", new DataParameter[] { new DataParameter("{0}", SubTaskID.TrimEnd(',')) });

                    //插入中間表
                    bllStock.BatchInsertTable(dt, "AsrsTask_TMP");

                    DataTable dtTaskID = dt.DefaultView.ToTable(true, "task_id");

                    List <string>          MiddleComds = new List <string>();
                    List <DataParameter[]> Middleparas = new List <DataParameter[]>();

                    List <string>          StockComds = new List <string>();
                    List <DataParameter[]> Stockparas = new List <DataParameter[]>();
                    for (int i = 0; i < dtTaskID.Rows.Count; i++)
                    {
                        DataRow[] drsTask = dt.Select(string.Format("task_id='{0}'", dtTaskID.Rows[i]["task_id"].ToString()));
                        //更新中間表状态
                        string taskID    = drsTask[0]["task_id"].ToString();
                        string SubtaskID = drsTask[0]["subtask_id"].ToString();

                        MiddleComds.Add("Middle.UpdateAsrsTaskAck");
                        MiddleComds.Add("Middle.UpdateAsrsSubTaskAck");
                        string strWhere = string.Format("subtask_id='{0}'", SubtaskID);
                        if (drsTask.Length > 1)
                        {
                            strWhere = "1=1";
                        }
                        Middleparas.Add(new DataParameter[] { new DataParameter("@TaskID", taskID) });
                        Middleparas.Add(new DataParameter[] { new DataParameter("@TaskID", taskID), new DataParameter("{0}", strWhere) });
                        for (int j = 0; j < drsTask.Length; j++)
                        {
                            SubtaskID = drsTask[j]["subtask_id"].ToString();
                            StockComds.Add("WCS.InsertWCSTask");
                            Stockparas.Add(new DataParameter[] { new DataParameter("@subtaskid", SubtaskID) });
                        }
                    }

                    bllStock.ExecTran(StockComds.ToArray(), Stockparas);

                    BLL.BLLBase bllMiddle = new BLLBase("MiddleDB");
                    if (blnUpdateAck)
                    {
                        bllMiddle.ExecTran(MiddleComds.ToArray(), Middleparas);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
コード例 #20
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateTempSub(this.dgViewSub1);

        DataTable dt        = (DataTable)ViewState[FormID + "_Edit_dgViewSub1"];
        DataTable dtProduct = dt.DefaultView.ToTable("Product", true, new string[] { "ProductCode", "ProductName" });

        for (int i = 0; i < dtProduct.Rows.Count; i++)
        {
            object o = dt.Compute("Count(ProductCode)", string.Format("ProductCode='{0}' and IsLock='0'", dtProduct.Rows[i]["ProductCode"]));
            if (o != null)
            {
                int Qty = int.Parse(o.ToString());
                if (Qty > 1)
                {
                    JScript.ShowMessage(this.updatePanel1, dtProduct.Rows[i]["ProductName"].ToString() + " 重复,请重新修改后保存!");
                    return;
                }
            }
        }

        DataRow[] drs   = dt.Select("IsLock='0'");
        string[]  Comds = new string[drs.Length + 1];
        List <DataParameter[]> paras = new List <DataParameter[]>();

        DataParameter[] para;
        for (int i = 0; i < drs.Length; i++)
        {
            DataRow dr       = drs[i];
            int     HasCount = bll.GetRowCount("WMS_Pallet", string.Format("PalletCode='{0}' and RowID='{1}'", dr["PalletCode"].ToString(), dr["RowID"].ToString()));
            if (HasCount > 0)
            {
                Comds[i] = "WMS.UpdatePallet";
                para     = new DataParameter[] { new DataParameter("@ProductCode", dr["ProductCode"].ToString()),
                                                 new DataParameter("@Quantity", dr["Quantity"].ToString()),
                                                 new DataParameter("@Weight", dr["Weight"].ToString()),
                                                 new DataParameter("@Memo", dr["Memo"].ToString()),
                                                 new DataParameter("@PalletCode", dr["PalletCode"].ToString()),
                                                 new DataParameter("@RowID", dr["RowID"].ToString()),
                                                 new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                                                 new DataParameter("@Updater", Session["EmployeeCode"].ToString()) };
            }
            else
            {
                Comds[i] = "WMS.InsertPallet";
                para     = new DataParameter[] {
                    new DataParameter("@PalletCode", dr["PalletCode"].ToString()),
                    new DataParameter("@RowID", dr["RowID"].ToString()),
                    new DataParameter("@ProductCode", dr["ProductCode"].ToString()),
                    new DataParameter("@Quantity", dr["Quantity"].ToString()),
                    new DataParameter("@Weight", dr["Weight"].ToString()),
                    new DataParameter("@Memo", dr["Memo"].ToString()),
                    new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                    new DataParameter("@Updater", Session["EmployeeCode"].ToString())
                };
            }
            paras.Add(para);
        }
        Comds[drs.Length] = "WMS.SpCreateTaskByPallet";
        para = new DataParameter[] { new DataParameter("@PalletCode", this.txtSearch.Text), new DataParameter("@UserName", Session["EmployeeCode"].ToString()) };
        paras.Add(para);
        try
        {
            bll.ExecTran(Comds, paras);
            this.txtSearch.Text = "";
            this.txtSearch.Attributes.Remove("ReadOnly");
            BindData("");
        }
        catch (Exception ex)
        {
            JScript.ShowMessage(this.updatePanel1, ex.Message);
            BindData(this.txtSearch.Text);
            return;
        }
    }
コード例 #21
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateTempSub(this.dgViewSub1);
        string[]        Commands = new string[3];
        DataParameter[] para;
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("WMS_BillMaster", string.Format("BillID='{0}'", this.txtID.Text.Trim()));
            if (Count > 0)
            {
                JScript.Instance.ShowMessage(this.updatePanel1, "该移库库单已经存在!");
                return;
            }
            para = new DataParameter[] {
                new DataParameter("@BillID", this.txtID.Text.Trim()),
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@BillTypeCode", "030"),
                new DataParameter("@AreaCode", this.ddlAreaCode.SelectedValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString())
            };
            Commands[0] = "WMS.InsertMoveStockBill";
        }
        else //修改
        {
            para = new DataParameter[] {
                new DataParameter("@BillDate", this.txtBillDate.DateValue),
                new DataParameter("@AreaCode", this.ddlAreaCode.SelectedValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("{0}", string.Format("BillID='{0}'", this.txtID.Text.Trim()))
            };
            Commands[0] = "WMS.UpdateMoveStock";
        }
        DataTable dt = (DataTable)ViewState[FormID + "_Edit_dgViewSub1"];

        //判断货位是否被其他单据锁定
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            int count = 0;
            count = bll.GetRowCount("Cmd_Cell", string.Format("CellCode='{0}' and IsLock=1", dt.Rows[i]["CellCode"]));
            if (count > 0)
            {
                JScript.Instance.ShowMessage(this.updatePanel1, "货位 " + dt.Rows[i]["CellCode"].ToString() + "已经被其它单据锁定,不能移库!");
                return;
            }
            count = bll.GetRowCount("Cmd_Cell", string.Format("CellCode='{0}' and IsLock=1", dt.Rows[i]["NewCellCode"]));
            if (count > 0)
            {
                JScript.Instance.ShowMessage(this.updatePanel1, "货位 " + dt.Rows[i]["NewCellCode"].ToString() + "已经被其它单据锁定,不能移库!");
                return;
            }
        }
        try
        {
            Commands[1] = "WMS.DeleteBillDetail";
            Commands[2] = "WMS.InsertMoveStockDetail";
            bll.ExecTran(Commands, para, "BillID", new DataTable[] { dt });
        }
        catch (Exception ex)
        {
            JScript.Instance.ShowMessage(this.updatePanel1, ex.Message);
            return;
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #22
0
ファイル: ProductEdit.aspx.cs プロジェクト: qq5013/ROBO
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.ShowMessage(this.Page, "该产品编号已经存在!");
                return;
            }

            //判断车型,轮对轴号 是否重复

            //Count=bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            //if (Count > 0)
            //{
            //    WMS.App_Code.JScript.ShowMessage(this.Page, "该产品编号已经存在!");
            //    return;
            //}
            //, , , , , , , , , ,
            //      , , , , , , , , , , ,
            //      , , , , Creator, CreateDate, Updater, UpdateDate, ,



            bll.ExecNonQuery("Cmd.InsertProduct", new DataParameter[] {
                new DataParameter("@ProductCode", this.txtID.Text.Trim()),
                new DataParameter("@ProductName", this.txtProductName.Text.Trim()),
                new DataParameter("@CategoryCode", this.ddlCategoryCode.SelectedValue),
                new DataParameter("@ProductEName", this.txtProductEName.Text),
                new DataParameter("@FactoryID", this.ddlFactory.SelectedValue),
                new DataParameter("@ModelNo", this.txtModelNo.Text.Trim()),
                new DataParameter("@Spec", this.txtSpec.Text.Trim()),
                new DataParameter("@Barcode", this.txtBarcode.Text.Trim()),
                new DataParameter("@Propertity", this.txtPropertity.Text.Trim()),
                new DataParameter("@Unit", this.txtUnit.Text.Trim()),
                new DataParameter("@Length", this.txtLength.Text.Trim()),
                new DataParameter("@Width", this.txtWidth.Text.Trim()),
                new DataParameter("@Height", this.txtHeight.Text.Trim()),
                new DataParameter("@Material", this.txtMaterial.Text.Trim()),
                new DataParameter("@Weight", this.txtWeight.Text.Trim()),
                new DataParameter("@Color", this.txtColor.Text.Trim()),
                new DataParameter("@StandardNo", this.txtStandardNo.Text.Trim()),
                new DataParameter("@PartNo", this.txtPartNo.Text.Trim()),
                new DataParameter("@ValidPeriod", this.txtValidPeriod.Text.Trim()),
                new DataParameter("@Description", this.txtDescription.Text.Trim()),
                new DataParameter("@AreaCode", bll.GetFieldValue("CMD_ProductCategory", "AreaCode", "CategoryCode='" + this.ddlCategoryCode.SelectedValue + "'")),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
            });
        }
        else //修改
        {
            //判断车型,轮对轴号 是否重复
            //int Count = bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            //if (Count > 0)
            //{
            //    WMS.App_Code.JScript.ShowMessage(this.Page, "该产品编号已经存在!");
            //    return;
            //}


            bll.ExecNonQuery("Cmd.UpdateProduct", new DataParameter[] {
                new DataParameter("@ProductName", this.txtProductName.Text.Trim()),
                new DataParameter("@CategoryCode", this.ddlCategoryCode.SelectedValue),
                new DataParameter("@ProductEName", this.txtProductEName.Text),
                new DataParameter("@FactoryID", this.ddlFactory.SelectedValue),
                new DataParameter("@ModelNo", this.txtModelNo.Text.Trim()),
                new DataParameter("@Spec", this.txtSpec.Text.Trim()),
                new DataParameter("@Barcode", this.txtBarcode.Text.Trim()),
                new DataParameter("@Propertity", this.txtPropertity.Text.Trim()),
                new DataParameter("@Unit", this.txtUnit.Text.Trim()),
                new DataParameter("@Length", this.txtLength.Text.Trim()),
                new DataParameter("@Width", this.txtWidth.Text.Trim()),
                new DataParameter("@Height", this.txtHeight.Text.Trim()),
                new DataParameter("@Material", this.txtMaterial.Text.Trim()),
                new DataParameter("@Weight", this.txtWeight.Text.Trim()),
                new DataParameter("@Color", this.txtColor.Text.Trim()),
                new DataParameter("@StandardNo", this.txtStandardNo.Text.Trim()),
                new DataParameter("@PartNo", this.txtPartNo.Text.Trim()),
                new DataParameter("@ValidPeriod", this.txtValidPeriod.Text.Trim()),
                new DataParameter("@Description", this.txtDescription.Text.Trim()),
                new DataParameter("@AreaCode", bll.GetFieldValue("CMD_ProductCategory", "AreaCode", "CategoryCode='" + this.ddlCategoryCode.SelectedValue + "'")),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("@ProductCode", this.txtID.Text.Trim())
            });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #23
0
ファイル: MachineEdit.aspx.cs プロジェクト: qq5013/CL_WMCS
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (strID == "") //新增
        {
            int Count = bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            if (Count > 0)
            {
                JScript.Instance.ShowMessage(this.Page, "该产品编号已经存在!");
                return;
            }

            //判断车型,轮对轴号 是否重复

            //Count=bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            //if (Count > 0)
            //{
            //    WMS.App_Code.JScript.Instance.ShowMessage(this.Page, "该产品编号已经存在!");
            //    return;
            //}
            //, , , , , , , , , ,
            //      , , , , , , , , , , ,
            //      , , , , Creator, CreateDate, Updater, UpdateDate, ,



            bll.ExecNonQuery("Cmd.InsertProduct", new DataParameter[] {
                new DataParameter("@ProductCode", this.txtID.Text.Trim()),
                new DataParameter("@ProductName", this.txtProductName.Text.Trim()),
                new DataParameter("@ProductTypeCode", this.ddlProductTypeCode.SelectedValue),
                new DataParameter("@TrainTypeCode", ""),
                new DataParameter("@AxieNo", this.txtAxieNo.Text.Trim()),
                new DataParameter("@WheelDiameter", this.txtWheelDiameter.Text.Trim()),
                new DataParameter("@CCZ_Diameter", this.txtCCZ_Diameter.Text.Trim()),
                new DataParameter("@FCCZ_Diameter", this.txtFCCZ_Diameter.Text.Trim()),
                new DataParameter("@CCD_Diameter", this.txtCCD_Diameter.Text.Trim()),
                new DataParameter("@FCCD_Diameter", this.txtFCCD_Diameter.Text.Trim()),
                new DataParameter("@CCXPBZW_Size", this.txtCCXPBZW_Size.Text.Trim()),
                new DataParameter("@FCCXPBZW_Size", this.txtFCCXPBZW_Size.Text.Trim()),
                new DataParameter("@GearNo", this.txtGearNo.Text.Trim()),
                new DataParameter("@CCLX_Flag", this.txtCCLX_Flag.Text.Trim()),
                new DataParameter("@FCCLX_Flag", this.txtFCCLX_Flag.Text.Trim()),
                new DataParameter("@CCLX_Year", this.txtCCLX_Year.Text.Trim()),
                new DataParameter("@FCCLX_Year", this.txtFCCLX_Year.Text.Trim()),
                new DataParameter("@CCLX_Factory", ""),
                new DataParameter("@FCCLX_Factory", ""),
                new DataParameter("@CX_Factory", this.ddlCX_Factory.SelectedValue),
                new DataParameter("@CCLG_Flag", this.txtCCLG_Flag.Text.Trim()),
                new DataParameter("@FCCLG_Flag", ""),
                new DataParameter("@WarehouseCode", ""),
                new DataParameter("@AreaCode", bll.GetFieldValue("CMD_ProductType", "AreaCode", "ProductTypeCode='" + this.ddlProductTypeCode.SelectedValue + "'")),
                new DataParameter("@LDXC", this.txtLDXC.Text.Trim()),
                new DataParameter("@CX_DateTime", this.txtCX_DateTime.DateValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("@IsTemp", chkTemp.Checked ? "1" :"0")
            });
        }
        else //修改
        {
            //判断车型,轮对轴号 是否重复
            //int Count = bll.GetRowCount("CMD_Product", string.Format("ProductCode='{0}'", this.txtID.Text));
            //if (Count > 0)
            //{
            //    WMS.App_Code.JScript.Instance.ShowMessage(this.Page, "该产品编号已经存在!");
            //    return;
            //}


            bll.ExecNonQuery("Cmd.UpdateProduct", new DataParameter[] {
                new DataParameter("@ProductName", this.txtProductName.Text.Trim()),
                new DataParameter("@ProductTypeCode", this.ddlProductTypeCode.SelectedValue),
                new DataParameter("@TrainTypeCode", ""),
                new DataParameter("@AxieNo", this.txtAxieNo.Text.Trim()),
                new DataParameter("@WheelDiameter", this.txtWheelDiameter.Text.Trim()),
                new DataParameter("@CCZ_Diameter", this.txtCCZ_Diameter.Text.Trim()),
                new DataParameter("@FCCZ_Diameter", this.txtFCCZ_Diameter.Text.Trim()),
                new DataParameter("@CCD_Diameter", this.txtCCD_Diameter.Text.Trim()),
                new DataParameter("@FCCD_Diameter", this.txtFCCD_Diameter.Text.Trim()),
                new DataParameter("@CCXPBZW_Size", this.txtCCXPBZW_Size.Text.Trim()),
                new DataParameter("@FCCXPBZW_Size", this.txtFCCXPBZW_Size.Text.Trim()),
                new DataParameter("@GearNo", this.txtGearNo.Text.Trim()),
                new DataParameter("@CCLX_Flag", this.txtCCLX_Flag.Text.Trim()),
                new DataParameter("@FCCLX_Flag", this.txtFCCLX_Flag.Text.Trim()),
                new DataParameter("@CCLX_Year", this.txtCCLX_Year.Text.Trim()),
                new DataParameter("@FCCLX_Year", this.txtFCCLX_Year.Text.Trim()),
                new DataParameter("@CCLX_Factory", ""),
                new DataParameter("@FCCLX_Factory", ""),
                new DataParameter("@CX_Factory", this.ddlCX_Factory.SelectedValue),
                new DataParameter("@CCLG_Flag", this.txtCCLG_Flag.Text.Trim()),
                new DataParameter("@FCCLG_Flag", ""),
                new DataParameter("@WarehouseCode", ""),
                new DataParameter("@AreaCode", bll.GetFieldValue("CMD_ProductType", "AreaCode", "ProductTypeCode='" + this.ddlProductTypeCode.SelectedValue + "'")),
                new DataParameter("@IsTemp", chkTemp.Checked ? "1" :"0"),
                new DataParameter("@LDXC", this.txtLDXC.Text.Trim()),
                new DataParameter("@CX_DateTime", this.txtCX_DateTime.DateValue),
                new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                new DataParameter("@ProductCode", this.txtID.Text.Trim())
            });
        }

        Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
    }
コード例 #24
0
    //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    ViewState["PageSize"] = this.ddlPageSize.SelectedValue;
    //    SetBtnEnabled("");
    //}
    /// <summary>
    /// 浏览界面每页笔数
    /// </summary>
    //private void BindPageSize()
    //{
    //    this.ddlPageSize.Items.Add(new ListItem("10", "10"));
    //    this.ddlPageSize.Items.Add(new ListItem("20", "20"));
    //    this.ddlPageSize.Items.Add(new ListItem("40", "40"));
    //    this.ddlPageSize.Items.Add(new ListItem("50", "50"));
    //}

    /// <summary>
    /// 綁定GirdView
    /// </summary>
    /// <param name="pageIndex"></param>
    private void BindGrid(int pageIndex)
    {
        totalCount = bll.GetRowCount(TableView, filter);
        pageCount  = GetPageCount(totalCount, pageSize);
        if (pageIndex == 0 || pageIndex > pageCount)
        {
            pageIndex = pageCount;
        }

        DataTable dt = bll.GetDataPage(pageIndex, pageSize, filter, orderBy, PrimaryKey, TableView, queryFields);


        if (dt.Rows.Count == 0)
        {
            dt.Rows.Add(dt.NewRow());
            GridView1.DataSource = dt;
            GridView1.DataBind();
            int columnCount = GridView1.Rows[0].Cells.Count;
            GridView1.Rows[0].Cells.Clear();
            GridView1.Rows[0].Cells.Add(new TableCell());
            GridView1.Rows[0].Cells[0].ColumnSpan = columnCount;
            GridView1.Rows[0].Cells[0].Text       = "没有符合以上条件的数据,请重新查询 ";
            GridView1.Rows[0].Visible             = true;

            this.btnFirst.Enabled  = false;
            this.btnPre.Enabled    = false;
            this.btnNext.Enabled   = false;
            this.btnLast.Enabled   = false;
            this.btnToPage.Enabled = false;
            this.lblPage.Visible   = false;
        }
        else
        {
            this.GridView1.DataSource = dt;
            this.GridView1.DataBind();

            this.btnLast.Enabled   = true;
            this.btnFirst.Enabled  = true;
            this.btnToPage.Enabled = true;

            if (pageIndex > 1)
            {
                this.btnPre.Enabled = true;
            }
            else
            {
                this.btnPre.Enabled = false;
            }

            if (pageIndex < pageCount)
            {
                this.btnNext.Enabled = true;
            }
            else
            {
                this.btnNext.Enabled = false;
            }

            lblPage.Visible = true;
            lblPage.Text    = "共 [" + totalCount.ToString() + "] 笔记录  第 [" + pageIndex.ToString() + "] 页  共 [" + pageCount.ToString() + "] 页";
        }
    }