コード例 #1
0
ファイル: frmBill.cs プロジェクト: shanzm/Winform-WMS
        private void frmBill_Load(object sender, EventArgs e)
        {
            BeginDate.Text = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01";
            endDate.Text   = DateTime.Now.ToShortDateString();


            LoadBill();

            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定类型
            dtl = DepotManage.GetStorageTypeData("I");
            cboStorageType.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboStorageType.Items.Add(dtl.Rows[i]["StorageTypeName"].ToString());
            }


            //绑定部门
            DeptManage DeptManage = new DeptManage();

            dtl = DeptManage.GetDeptData();
            cboDept.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDept.Items.Add(dtl.Rows[i]["部门名称"].ToString());
            }


            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }


            //绑定供应商
            SupplierManage SupplierManage = new SupplierManage();

            dtl = SupplierManage.GetSupplierData();
            cboSupplier.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboSupplier.Items.Add(dtl.Rows[i]["供应商名称"].ToString());
            }
        }
コード例 #2
0
 public SupplierManager()
 {
     InitializeComponent();
     manage = new SupplierManage();
     manage.setManager(this);
     manage.ToDGV();
 }
コード例 #3
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="MaterialGuid"></param>
        private void FillData(string SupplierGuid)
        {
            SupplierManage suppliermanage = new SupplierManage();
            DataTable      dtl            = suppliermanage.GetSupplierData_CN(SupplierGuid);

            if (dtl.Rows.Count > 0)
            {
                txtGuid.Text        = dtl.Rows[0]["Guid"].ToString();
                txtName.Text        = dtl.Rows[0]["Name"].ToString();
                txtSimpName.Text    = dtl.Rows[0]["SimpName"].ToString();
                txtLinkMan.Text     = dtl.Rows[0]["LinkMan"].ToString();
                txtTelephone.Text   = dtl.Rows[0]["Telephone"].ToString();
                txtFax.Text         = dtl.Rows[0]["Fax"].ToString();
                txtAddress.Text     = dtl.Rows[0]["Address"].ToString();
                txtZip.Text         = dtl.Rows[0]["Zip"].ToString();
                txtRemark.Text      = dtl.Rows[0]["Remark"].ToString();
                txtProduceType.Text = dtl.Rows[0]["ProduceType"].ToString();

                if (dtl.Rows[0]["IsEnable"].ToString() == "1")
                {
                    chkIsEnable.Checked = true;
                }
                else
                {
                    chkIsEnable.Checked = false;
                }
            }

            this.ShowDialog();
        }
コード例 #4
0
        /// <summary>
        /// 取得聯絡人詳細資料
        /// </summary>
        /// <param name="contactid"></param>
        /// <returns></returns>
        public string getContact(string supplierid)
        {
            SupplierManage supplierService = new SupplierManage();

            log.Info("get contact info by supplier id=" + supplierid);
            System.Web.Script.Serialization.JavaScriptSerializer objSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string itemJson = objSerializer.Serialize(supplierService.getContactById(supplierid));

            log.Info("supplier's Info=" + itemJson);
            return(itemJson);
        }
コード例 #5
0
        //取得供應商資料
        public ActionResult Create(string id)
        {
            log.Info("http get mehtod:" + id);
            SupplierManage supplierService = new SupplierManage();
            SupplierDetail singleForm      = new SupplierDetail();

            supplierService.getSupplierBySupId(id);
            singleForm.sup         = supplierService.supplier;
            singleForm.contactItem = supplierService.contactList;
            log.Debug("Supplier ID:" + singleForm.sup.SUPPLIER_ID);
            return(View(singleForm));
        }
コード例 #6
0
        //取得廠商聯絡人資料
        public string getContactor()
        {
            List <TND_SUP_CONTACT_INFO> ls = null;

            log.Debug("get contact By suppliername:" + Request["Supplier"] + ", " + Request["Supplier"].Substring(0, 7));
            SupplierManage s     = new SupplierManage();
            string         supid = Request["Supplier"].Substring(0, 7);

            ls = s.getContactBySupplier(supid);
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            return(serializer.Serialize(ls));
        }
コード例 #7
0
 public SupplierEditor(ref SupplierManage m)
 {
     InitializeComponent();
     data = DataConexion.getInstance();
     model = new ModelSupplier();
     manage = m;
     this.selectCiudad.DataSource = new ModelCountry().getAlltoSortedList().GetValueList();
     try
     {
         selectCiudad.SelectedIndex = 0;
     }
     catch (Exception exc) {
         Utils.logExceptionError(exc);
     }
 }
コード例 #8
0
        public ActionResult AddSupplier(TND_SUPPLIER sup)
        {
            log.Info("create supplier process! supplier =" + sup.ToString());
            SupplierManage supplierService = new SupplierManage();
            SYS_USER       u       = (SYS_USER)Session["user"];
            string         message = "";

            //1.新增供應商
            if (sup.SUPPLIER_ID == "" || sup.SUPPLIER_ID == null)
            {
                //新增供應商編號
                supplierService.newSupplier(sup);
                message = "輸入供應商基本資料 ! 若有聯絡人請先新增完聯絡人資料,再輸入供應商資料";
            }
            TempData["result"] = message;
            return(Redirect("Create?id=" + sup.SUPPLIER_ID));
        }
コード例 #9
0
        /// <summary>
        /// 数据选择:1:员工 2:部门  3:供应商  4:客户
        /// </summary>
        /// <param name="flag"></param>
        public void ShowSelectData(int flag)
        {
            intFlag = flag;
            DataTable dtl = new DataTable();

            switch (flag)
            {
            case 1:     //员工
                EmployeeManage EmployeeManage = new EmployeeManage();
                dtl = EmployeeManage.GetEmployeeDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "员工编号";
                gridView1.Columns[2].Caption = "员工姓名";
                gridView1.Columns[3].Caption = "部门";
                this.Text = "员工选择";
                break;

            case 2:     //部门
                DeptManage DeptManage = new DeptManage();
                dtl = DeptManage.GetDeptDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "部门名称";
                this.Text = "部门选择";
                break;

            case 3:     //供应商
                SupplierManage SupplierManage = new SupplierManage();
                dtl = SupplierManage.GetSupplierDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "供应商名称";
                this.Text = "供应商选择";
                break;

            case 4:     //客户
                ClientManage ClientManage = new ClientManage();
                dtl = ClientManage.GetClientDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "客户名称";
                this.Text = "客户选择";
                break;
            }

            gridView1.Columns[0].Visible = false;
            this.ShowDialog();
        }
コード例 #10
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="MaterialGuid"></param>
        private void FillData(string SupplierGuid)
        {
            SupplierManage suppliermanage = new SupplierManage();
            DataTable      dtl            = suppliermanage.GetSupplierData_CN(SupplierGuid);

            if (dtl.Rows.Count > 0)
            {
                txtGuid.Text      = dtl.Rows[0]["Guid"].ToString();
                txtName.Text      = dtl.Rows[0]["Name"].ToString();
                txtSimpName.Text  = dtl.Rows[0]["SimpName"].ToString();
                txtLinkMan.Text   = dtl.Rows[0]["LinkMan"].ToString();
                txtTelephone.Text = dtl.Rows[0]["Telephone"].ToString();
                txtFax.Text       = dtl.Rows[0]["Fax"].ToString();
                txtAddress.Text   = dtl.Rows[0]["Address"].ToString();
                txtZip.Text       = dtl.Rows[0]["Zip"].ToString();
                txtRemark.Text    = dtl.Rows[0]["Remark"].ToString();
            }

            this.ShowDialog();
        }
コード例 #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (HttpContext.Current.Session["user"] == null)
     {
         Response.Write("<script language='javascript'>alert('登录信息过期,请重新登录');location.href='../../Login/Login.aspx'</script>");
     }
     else
     {
         Dictionary <string, string> user = HttpContext.Current.Session["user"] as Dictionary <string, string>;
         try
         {
             storeId = int.Parse(user["storeID"]);
         }
         catch
         {
             Response.Write("<script language='javascript'>alert('您没有绑定的仓库');location.href='../../Home/Home.aspx'</script>");
         };
         userNum   = user["num"];
         category  = CategoryManage.GetCate();
         suppliers = SupplierManage.GetSuppliers();
     }
 }
コード例 #12
0
        //选择供应商
        private void btnSelect_Click(object sender, EventArgs e)
        {
            frmSelectOtherData frmSelectOtherData = new frmSelectOtherData();

            frmSelectOtherData.ShowSelectData(3);
            if (frmSelectOtherData.Tag != null)
            {
                if (frmSelectOtherData.Tag.ToString().Trim() == "ClearTextBox")
                {
                    txtSupplier.Text = ""; //名称
                    txtSupplier.Tag  = ""; //Guid

                    txtLinkman.Text   = "";
                    txtTelephone.Text = "";
                    txtFax.Text       = "";
                }
                else
                {
                    string[] arrValue = frmSelectOtherData.Tag.ToString().Split('|');

                    if (arrValue.Length > 0)
                    {
                        txtSupplier.Text = arrValue[1]; //名称
                        txtSupplier.Tag  = arrValue[0]; //Guid

                        //根据此供应商自动填充此供应商的联系人,联系电话及传真
                        SupplierManage SupplierManage = new SupplierManage();
                        DataTable      dtl            = SupplierManage.GetSupplierData_CN(txtSupplier.Tag.ToString());
                        if (dtl.Rows.Count > 0)
                        {
                            txtLinkman.Text   = dtl.Rows[0]["LinkMan"].ToString();
                            txtTelephone.Text = dtl.Rows[0]["Telephone"].ToString();
                            txtFax.Text       = dtl.Rows[0]["Fax"].ToString();
                        }
                    }
                }
            }
        }
コード例 #13
0
        //新增供應聯絡人
        public String addContact(FormCollection form)
        {
            log.Info("form:" + form.Count);
            string msg = "新增聯絡人成功!!";

            TND_SUP_CONTACT_INFO item = new TND_SUP_CONTACT_INFO();

            item.SUPPLIER_MATERIAL_ID = form["supplier_id"];
            item.CONTACT_NAME         = form["contact_name"];
            item.CONTACT_TEL          = form["contact_tel"];
            item.CONTACT_FAX          = form["contact_fax"];
            item.CONTACT_MOBIL        = form["contact_mobil"];
            item.CONTACT_EMAIL        = form["contact_email"];
            item.REMARK = form["remark"];
            SupplierManage supplierService = new SupplierManage();
            int            i = supplierService.refreshContact(item);

            if (i == 0)
            {
                msg = supplierService.message;
            }
            return(msg);
        }
コード例 #14
0
        //更新供應商資料
        public String RefreshSupplier(string id, FormCollection form)
        {
            log.Info("form:" + form.Count);
            string msg = "";
            // 取得供應商資料
            TND_SUPPLIER sup = new TND_SUPPLIER();

            sup.SUPPLIER_ID      = form.Get("supplierid").Trim();
            sup.COMPANY_NAME     = form.Get("company_name").Trim();
            sup.COMPANY_ID       = form.Get("company_id").Trim();
            sup.CONTACT_ADDRESS  = form.Get("contact_address").Trim();
            sup.REGISTER_ADDRESS = form.Get("register_address").Trim();
            sup.TYPE_MAIN        = form.Get("type_main").Trim();
            try
            {
                sup.TYPE_SUB = int.Parse(form.Get("type_sub").Trim());
            }
            catch (Exception ex)
            {
                log.Error(ex.StackTrace);
            }
            sup.SUPPLY_NOTE = form.Get("supply_note").Trim();
            SupplierManage supplierService = new SupplierManage();
            string         supplierid      = form.Get("supplierid").Trim();

            if (form.Get("contactid") != null && "" != form.Get("contactid"))
            {
                string[] lstItemId = form.Get("contactid").Split(',');
                string[] lstName   = form.Get("contactname").Split(',');
                string[] lstTel    = form.Get("contacttel").Split(',');
                string[] lstFax    = form.Get("contactfax").Split(',');
                string[] lstMobile = form.Get("contactmobil").Split(',');
                string[] lstEmail  = form.Get("contactemail").Split(',');
                string[] lstRemark = form.Get("contactremark").Split(',');
                List <TND_SUP_CONTACT_INFO> lstItem = new List <TND_SUP_CONTACT_INFO>();
                for (int j = 0; j < lstItemId.Count(); j++)
                {
                    TND_SUP_CONTACT_INFO item = new TND_SUP_CONTACT_INFO();
                    item.CONTACT_ID    = int.Parse(lstItemId[j]);
                    item.CONTACT_NAME  = lstName[j];
                    item.CONTACT_TEL   = lstTel[j];
                    item.CONTACT_FAX   = lstFax[j];
                    item.CONTACT_MOBIL = lstMobile[j];
                    item.CONTACT_EMAIL = lstEmail[j];
                    item.REMARK        = lstRemark[j];
                    lstItem.Add(item);
                }

                int i = supplierService.updateSupplier(supplierid, sup, lstItem);
                if (i == 0)
                {
                    msg = supplierService.message;
                }
                else
                {
                    msg = "更新/新增供應商資料成功,SUPPLIER_ID =" + supplierid;
                }

                log.Info("Request: SUPPLIER_ID = " + supplierid + "CONTACT_ID =" + form["contact_id"]);
                return(msg);
            }
            int k = supplierService.updateOnlySupplier(supplierid, sup);

            if (k == 0)
            {
                msg = supplierService.message;
            }
            else
            {
                msg = "更新/新增供應商資料成功,SUPPLIER_ID =" + supplierid;
            }

            log.Info("Request: SUPPLIER_ID = " + supplierid + "CONTACT_ID =" + form["contact_id"]);
            return(msg);
        }
コード例 #15
0
        private void CboBind(string flag)
        {
            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定类型
            dtl = DepotManage.GetStorageTypeData(flag);
            cboStorageType.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboStorageType.Items.Add(dtl.Rows[i]["StorageTypeName"].ToString());
            }


            //绑定部门
            DeptManage DeptManage = new DeptManage();

            dtl = DeptManage.GetDeptData();
            cboDept.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDept.Items.Add(dtl.Rows[i]["部门名称"].ToString());
            }


            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }

            //绑定供应商
            if (flag == "I")
            {
                SupplierManage SupplierManage = new SupplierManage();
                dtl = SupplierManage.GetSupplierData();
                cboSupplier.Items.Add("");
                for (int i = 0; i < dtl.Rows.Count; i++)
                {
                    cboSupplier.Items.Add(dtl.Rows[i]["供应商名称"].ToString());
                }
            }
            else
            {
                ClientManage ClientManage = new ClientManage();
                dtl = ClientManage.GetClientData();
                cboSupplier.Items.Add("");
                for (int i = 0; i < dtl.Rows.Count; i++)
                {
                    cboSupplier.Items.Add(dtl.Rows[i]["客户名称"].ToString());
                }
            }
        }