Esempio n. 1
0
        public string GetSQLConnect()
        {
            ERPInquire3.HelpClass.iniFileHelper myIni = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
            string IP  = myIni.IniReadValue("SqlConnect", "IP");
            string DB  = myIni.IniReadValue("SqlConnect", "DB");
            string Uid = myIni.IniReadValue("SqlConnect", "Uid");
            string Pwd = myIni.IniReadValue("SqlConnect", "Pwd");

            return("server=" + IP + ";uid=" + Uid + ";pwd=" + Pwd + ";Trusted_Connection=no;database=" + DB + "");
        }
Esempio n. 2
0
        private void Hello_Load(object sender, EventArgs e)
        {
            ERPInquire3.HelpClass.iniFileHelper ini = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
            string s = ini.ReadString("Login", "Name", "");

            string[] ss = s.Split('-');
            name        = ss[1];
            label1.Text = "欢迎" + name + "使用WMS仓库管理系统";
            //label1.TextAlign = ContentAlignment.MiddleCenter;
        }
Esempio n. 3
0
        private void 修改密码ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WMS_Gimped.Frm.ChangePwd            cp  = WMS_Gimped.Frm.ChangePwd.CreateInstrance();
            ERPInquire3.HelpClass.iniFileHelper ini = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
            string name = ini.ReadString("Login", "Name", "");

            string[] s = name.Split('-');
            cp.code = s[0];
            cp.name = s[1];
            toolStripStatusLabel4.Text = "修改密码";
            cp.Show();
        }
Esempio n. 4
0
        //确定
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            //每盘入库数量必须要全部入库,不能剩余物料
            if (!Convert.ToUInt64(textBox7.Text).Equals(0))
            {
                MessageBox.Show("存在未入库的产品", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (dataGridView1.RowCount.Equals(0))
            {
                MessageBox.Show("请添加每盘入库明细", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            try
            {
                #region 将数据录入系统中
                Maticsoft.Model.WMS_CL cl    = new Maticsoft.Model.WMS_CL();
                Maticsoft.DAL.WMS_CL   cldal = new Maticsoft.DAL.WMS_CL();
                cl.ID     = Guid.NewGuid().ToString();
                cl.CLTYPE = "0";
                cl.CLBH   = CLBM;
                cl.CLMC   = CLMC;
                //cl.SGBH=
                cldal.Add(cl);
                #endregion

                #region 审核入库单
                //将未审核的入库单变成已审核的状态,审核级别到达物料层次
                SqlParameter[] para =
                {
                    new SqlParameter("@BDBH", SqlDbType.Text),
                    new SqlParameter("@WLBM", SqlDbType.Text),
                    new SqlParameter("@SHR",  SqlDbType.Text)
                };
                ERPInquire3.HelpClass.iniFileHelper ini = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
                para[0].Value = BDBH;
                para[1].Value = CLBM;
                para[2].Value = ini.ReadString("Login", "Code", "");
                SqlHelper.ExecStoredProcedureDataTable("WMS_RKBJ1", para);
                #endregion

                #region 委托调用窗体更新
                DialogResult = DialogResult.OK;
                #endregion
            }
            catch
            {
            }
            finally
            {
            }
        }
Esempio n. 5
0
        //登录
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            if (CheckPasswordCorrectness(comboBox1.SelectedValue.ToString(), textBox1.Text) == true)
            {
                //将登录人员信息写入配置文件中
                ERPInquire3.HelpClass.iniFileHelper ini = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
                string code = GetRSCode(comboBox1.Text);
                if (!code.Equals("FLASE"))
                {
                    ini.WriteString("Login", "Code", code);
                    ini.WriteString("Login", "Name", code + "-" + comboBox1.Text);
                    Mainfrm.Dialog = "OK";
                    switch (textBox5.Text)
                    {
                    case "成品库":
                        Mainfrm.Status = "0";
                        break;

                    case "材料库":
                        Mainfrm.Status = "1";
                        break;

                    case "全部库":
                        Mainfrm.Status = "2";
                        break;
                    }

                    Mainfrm.LoginName = comboBox1.Text;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("此用户未在ERP上注册", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            else
            {
                MessageBox.Show("密码输入不正确,请核对后输入", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Esempio n. 6
0
        //确定分盘操作结果
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            if (!Convert.ToUInt64(textBox7.Text).Equals(0))
            {
                MessageBox.Show("存在未入库的产品", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (dataGridView1.RowCount.Equals(0))
            {
                MessageBox.Show("请添加每盘入库明细", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            #region 审核入库单
            SqlParameter[] para =
            {
                new SqlParameter("@BDBH", SqlDbType.Text),
                new SqlParameter("@SHR",  SqlDbType.Text),
            };
            ERPInquire3.HelpClass.iniFileHelper ini = new ERPInquire3.HelpClass.iniFileHelper(Application.StartupPath + "/data/Config.ini");
            para[0].Value = BDBH;
            para[1].Value = ini.ReadString("Login", "Code", "");
            SqlHelper.ExecStoredProcedureDataTable("WMS_RKBJ", para);
            #endregion

            #region 将数据录入系统中
            Model.CP C1 = new Model.CP();
            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                C1.Id     = Guid.NewGuid().ToString();                                         //ID
                C1.Cptype = "0";                                                               //类型
                C1.Cpbh   = CPBH;                                                              //产品编号
                C1.Cpmc   = CPMC;                                                              //产品名称
                C1.Bdbh   = BDBH;                                                              //入库单号
                C1.Cw     = dataGridView1.Rows[i].Cells[0].Value.ToString();                   //仓位名称
                C1.Sl1    = Convert.ToUInt32(RKSL);                                            //入库数量
                C1.Sl2    = Convert.ToUInt32(dataGridView1.Rows[i].Cells[1].Value.ToString()); //每盘入库数量
                C1.Sl3    = Convert.ToUInt32(dataGridView1.Rows[i].Cells[1].Value.ToString()); //每盘出库余量
                C1.Ddsl   = Convert.ToInt64(DDSL);                                             //订单数量
                C1.Zdrq   = Convert.ToDateTime(ZDRQ);                                          //制单日期
                C1.Rq     = DateTime.Now;                                                      //入库时间
                C1.Dw     = DWMC;                                                              //单位
                C1.Remark = richTextBox1.Text;                                                 //备注
                C1.TYDH   = GetGDH(BDBH);
                SQL.SqlExecute.CPInsert(C1);

                #region dtpublic创建时间
                DataRow drrow = dtpublic.NewRow();     //创建新行
                drrow["入库单号"]   = BDBH;
                drrow["产品编号"]   = CPBH;
                drrow["产品名称"]   = CPMC;
                drrow["仓位名称"]   = dataGridView1.Rows[i].Cells[0].Value.ToString();
                drrow["每盘入库数量"] = dataGridView1.Rows[i].Cells[1].Value.ToString();
                drrow["单位"]     = DWMC;
                drrow["入库时间"]   = DateTime.Now;
                dtpublic.Rows.Add(drrow);     //将新行加入到表中
                #endregion
            }
            #endregion

            #region 返回页面刷新页面
            DialogResult = DialogResult.OK;
            #endregion
        }