Example #1
0
        private void getMain()
        {
            string id = Request.QueryString["id"].ToString();

            EtNet_Models.Factory cus = FactoryManager.getFactoryById(Convert.ToInt32(id));
            this.lblBank.Text   = cus.Bank.ToString();
            this.lblCardID.Text = cus.AccountID.ToString();
            this.lblName.Text   = cus.AccountName.ToString();
            this.lblRemark.Text = cus.Remark.ToString();
        }
        //保存修改后的资料(未审核)
        private void AddBase(string sort)
        {
            string factid = Request.QueryString["id"].ToString();

            EtNet_Models.Factory fact = FactoryManager.getFactoryById(Convert.ToInt32(factid));


            //基本信息
            // EtNet_Models.Customer cus = new EtNet_Models.Customer();
            fact.Id            = Convert.ToInt32(Request.QueryString["id"].ToString());
            fact.FactCode      = this.cusCode.Value.ToString();
            fact.Codeformat    = this.hidcodeformat.Value;
            fact.Ordernum      = this.hidordernum.Value;
            fact.FactshortName = this.cusshortname.Value.ToString();

            fact.FactType = Convert.ToInt32(this.HidTypeID.Value);
            string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/');
            fact.Province     = addre[0].ToString();
            fact.City         = addre[1].ToString();
            fact.FactCName    = this.cusCName.Value.ToString();
            fact.FactCAddress = this.cusCAddress.Value.ToString();
            fact.Used         = Convert.ToInt32(this.rbUsed.SelectedItem.Value);
            //联系人
            fact.LinkeName = this.linkName.Value.ToString();
            fact.Duty      = this.linkPost.Value.ToString();
            fact.Telephone = this.linkTel.Value.ToString();
            fact.Mobile    = this.linkMobile.Value.ToString();
            fact.Fax       = this.linkFax.Value.ToString();
            fact.Email     = this.linkEmail.Value.ToString();
            fact.QQ        = this.linkMsn.Value.ToString();
            fact.Skype     = this.linkSkype.Value.ToString();


            //银行信息
            fact.Bank        = this.bankName.Value.ToString();
            fact.AccountID   = this.bankCard.Value.ToString();
            fact.AccountName = this.bankMan.Value.ToString();
            fact.Remark      = this.bankremark.Value.ToString();
            //fact.Inputname = ((LoginInfo)Session["Login"]).Id;
            //fact.Inputdate = DateTime.Now;
            fact.LastEditMan  = ((LoginInfo)Session["login"]).Cname;
            fact.LastEditDate = DateTime.Now;
            int count = FactoryManager.updateFactory(fact);

            if (count > 0)
            {
                addbank();
                addlink();

                if (sort == "save")
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('付款单位修改成功!');location.href='../Supplier/" + Request.QueryString["backURL"] + "'", true);
                }
            }
        }
        //绑定公司类别
        //private void bindList()
        //{
        //    this.ddlList.Items.Clear();
        //    IList<CusType> typelist = CusTypeManager.getCusTypeAll();
        //    foreach (var item in typelist)
        //    {
        //        ListItem list = new ListItem(item.TypeName, item.Id.ToString());
        //        this.ddlList.Items.Add(list);
        //    }
        //    ListItem ltem = new ListItem("选择类别", "-1");//添加第一行默认值
        //    this.ddlList.Items.Insert(0, ltem);//添加第一行默认值
        //}


        ///// <summary>
        ///// 审核流规则
        ///// </summary>
        //private void LoadRule()
        //{
        //    EtNet_Models.LoginInfo login = (EtNet_Models.LoginInfo)Session["login"];
        //    string fields = " id,(sort + '—' + cname  ) as rulename ";
        //   // string strsql = " jobflowsort='03' AND  ',' + departidlist + ',' like '%," + login.Departid.ToString() + ",%' ";
        //    //DataTable tbl = EtNet_BLL.ViewBLL.ViewApprovalRuleManager.getList(fields, strsql);
        //    DataRow row = tbl.NewRow();
        //    row["id"] = "0";
        //    row["rulename"] = "——请选中——";
        //    tbl.Rows.InsertAt(row, 0);
        //    this.ddlrule.DataSource = tbl;
        //    this.ddlrule.DataValueField = "id";
        //    this.ddlrule.DataTextField = "rulename";
        //    this.ddlrule.DataBind();
        //}



        //加载基本信息
        private void loadcus()
        {
            string factid = Request.QueryString["id"].ToString();

            EtNet_Models.Factory fact = FactoryManager.getFactoryById(Convert.ToInt32(factid));
            this.cusshortname.Value   = fact.FactshortName.ToString();
            this.cusCName.Value       = fact.FactCName.ToString();
            this.cusCode.Value        = fact.FactCode.ToString();
            this.hidordernum.Value    = fact.Ordernum;
            this.hidcodeformat.Value  = fact.Codeformat;
            this.cusCAddress.Value    = fact.FactCAddress.ToString();
            this.address.Text         = fact.Province.ToString() + " " + fact.City.ToString();
            this.lblMadeFrom.Value    = LoginInfoManager.getLoginInfoById(fact.Inputname).Cname;
            this.lblMadeTime.Value    = fact.Inputdate.ToString("yyyy-MM-dd");
            this.rbUsed.SelectedValue = fact.Used.ToString();
            //this.txtcustype.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName.ToString();
            int id = fact.FactType;

            if (id > 0)
            {
                this.TxtType.Text = FactTypeManager.getFactTypeById(fact.FactType).TypeName;
            }
            else
            {
                this.TxtType.Text = "";
            }


            this.HidTypeID.Value = fact.FactType.ToString();
            //主要联系人
            this.linkName.Value   = fact.LinkeName.ToString();
            this.linkPost.Value   = fact.Duty.ToString();
            this.linkTel.Value    = fact.Telephone.ToString();
            this.linkMobile.Value = fact.Mobile.ToString();
            this.linkFax.Value    = fact.Fax.ToString();
            this.linkEmail.Value  = fact.Email.ToString();
            this.linkMsn.Value    = fact.QQ.ToString();
            this.linkSkype.Value  = fact.Skype.ToString();

            //主要银行信息
            this.bankName.Value   = fact.Bank.ToString();
            this.bankCard.Value   = fact.AccountID.ToString();
            this.bankMan.Value    = fact.AccountName.ToString();
            this.bankremark.Value = fact.Remark.ToString();
            //加载修改信息
            DataTable dt = FactoryManager.getList(" id =" + factid);

            this.lblEditMan.Value  = dt.Rows[0]["lasteditman"].ToString();
            this.lblEditDate.Value = Convert.IsDBNull(dt.Rows[0]["lasteditdate"]) ? "" : Convert.ToDateTime(dt.Rows[0]["lasteditdate"]).ToString("yyyy-MM-dd");

            //SpecialSet(cusid);
        }
Example #4
0
        private void getmainlink()
        {
            string id = Request.QueryString["id"].ToString();

            EtNet_Models.Factory fact = FactoryManager.getFactoryById(Convert.ToInt32(id));
            this.lblLinkname.Text = fact.LinkeName.ToString();
            this.lblPost.Text     = fact.Duty.ToString();
            this.lblTel.Text      = fact.Telephone.ToString();
            this.lblFax.Text      = fact.Fax.ToString();
            this.lblEmail.Text    = fact.Email.ToString();
            this.lblMobile.Text   = fact.Mobile.ToString();
            this.lblMsn.Text      = fact.QQ.ToString();
            this.lblSkype.Text    = fact.Skype.ToString();
        }
        //修改(已审核)
        protected void imgbtnmodify_Click(object sender, ImageClickEventArgs e)
        {
            string cusCode      = this.cusCode.Value.ToString();
            string cusshortname = this.cusshortname.Value.ToString();
            string cusCName     = this.cusCName.Value.ToString();
            int    id           = Convert.ToInt32(Request.QueryString["id"].ToString());
            string str          = "";

            if (FactoryManager.getSName(cusshortname, id))
            {
                str += "供应商简称已存在\\n";
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + str + "');", true);
                return;
            }
            if (FactoryManager.getCName(cusCName, id))
            {
                str += "供应商全称已存在\\n";
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + str + "');", true);
                return;
            }

            string cusid = Request.QueryString["id"].ToString();

            EtNet_Models.Factory cus = FactoryManager.getFactoryById(Convert.ToInt32(cusid));

            //基本信息
            // EtNet_Models.Customer cus = new EtNet_Models.Customer();
            cus.Id            = Convert.ToInt32(Request.QueryString["id"].ToString());
            cus.FactCode      = this.cusCode.Value.ToString();
            cus.Codeformat    = this.hidcodeformat.Value;
            cus.Ordernum      = this.hidordernum.Value;
            cus.FactshortName = this.cusshortname.Value.ToString();
            // cus.Province = this.ddlProvince.SelectedValue;
            //cus.City = this.ddlCity.SelectedValue;
            cus.FactType = Convert.ToInt32(this.HidTypeID.Value);
            string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/');
            cus.Province     = addre[0].ToString();
            cus.City         = addre[1].ToString();
            cus.FactCName    = this.cusCName.Value.ToString();
            cus.FactCAddress = this.cusCAddress.Value.ToString();
            cus.Used         = Convert.ToInt32(this.rbUsed.SelectedItem.Value);
            //联系人
            cus.LinkeName = this.linkName.Value.ToString();
            cus.Duty      = this.linkPost.Value.ToString();
            cus.Telephone = this.linkTel.Value.ToString();
            cus.Mobile    = this.linkMobile.Value.ToString();
            cus.Fax       = this.linkFax.Value.ToString();
            cus.Email     = this.linkEmail.Value.ToString();
            cus.QQ        = this.linkMsn.Value.ToString();
            cus.Skype     = this.linkSkype.Value.ToString();


            //银行信息
            cus.Bank        = this.bankName.Value.ToString();
            cus.AccountID   = this.bankCard.Value.ToString();
            cus.AccountName = this.bankMan.Value.ToString();
            cus.Remark      = this.bankremark.Value.ToString();
            cus.Inputname   = ((LoginInfo)Session["Login"]).Id;
            cus.Inputdate   = DateTime.Now;
            int count = FactoryManager.updateFactory(cus);

            if (count > 0)
            {
                addbank();
                addlink();
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('供应商修改成功!');location.href='../Supplier/" + Request.QueryString["backURL"] + "'", true);
            }
        }
Example #6
0
        /// <summary>
        /// 添加付款单位信息
        /// </summary>
        private void AddBase(string sort)
        {
            string cuscode    = ""; //公司代码全称
            string codeformat = ""; //公司代码,不包含流水号
            string ordernum   = ""; //流水号

            if (StrNumbers(this.factCode.Value, out cuscode, out codeformat, out ordernum))
            {
                EtNet_Models.JobFlow model = new JobFlow();
                model.attachment  = codeformat;
                model.txt         = ordernum;
                model.cname       = cuscode;
                model.sort        = "03"; //付款单位管理申请
                model.auditsort   = "";
                model.auditstatus = "01";
                model.createtime  = DateTime.Now;                                  //默认是当前时间
                model.endtime     = DateTime.Now;
                model.founderid   = ((EtNet_Models.LoginInfo)Session["login"]).Id; //登录人员的id
                //model.ruleid = int.Parse(this.ddlrule.SelectedValue);
                //if (sort == "save")
                //{
                //    model.savestatus = "草稿";
                //}
                //else
                //{
                //    model.savestatus = "已提交";
                //}
                //int maxid = EtNet_BLL.JobFlowManager.AddAndGetId(model); //工作流的id值
                //基本信息
                EtNet_Models.Factory fact = new EtNet_Models.Factory();
                fact.FactCode   = cuscode;
                fact.Codeformat = codeformat;
                fact.Ordernum   = ordernum;
                fact.FactType   = Convert.ToInt32(this.HidTypeID.Value);
                // cus.Province = this.ddlProvince.SelectedValue;
                //cus.City = this.ddlCity.SelectedValue;
                fact.FactshortName = this.cusshortname.Value.ToString();
                string[] addre = this.address.Text.ToString().Split(' ');// string[] sailing = args.Split('/');
                fact.Province = addre[0].ToString();
                fact.City     = addre[1].ToString();


                fact.FactCName    = this.cusCName.Value.ToString();
                fact.FactCAddress = this.cusCAddress.Value.ToString();
                fact.Used         = Convert.ToInt32(this.rbUsed.SelectedItem.Value);

                //联系人
                fact.LinkeName = this.linkName.Value.ToString();
                fact.Duty      = this.linkPost.Value.ToString();
                fact.Telephone = this.linkTel.Value.ToString();
                fact.Mobile    = this.linkMobile.Value.ToString();
                fact.Fax       = this.linkFax.Value.ToString();
                fact.Email     = this.linkEmail.Value.ToString();
                fact.QQ        = this.linkMsn.Value.ToString();
                fact.Skype     = this.linkSkype.Value.ToString();


                //银行信息
                fact.Bank        = this.bankName.Value.ToString();
                fact.AccountID   = this.bankCard.Value.ToString();
                fact.AccountName = this.bankMan.Value.ToString();
                fact.Remark      = this.bankremark.Value;
                fact.Inputname   = ((LoginInfo)Session["login"]).Id;
                fact.Inputdate   = DateTime.Now;
                int count = FactoryManager.addFactory(fact);
                if (count > 0)
                {
                    addlink();
                    addbank();

                    if (sort == "save")
                    {
                        this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('保存成功!');location.href='../Supplier/Supplier.aspx'", true);
                    }
                    else
                    {
                        this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('送审成功!');location.href='../Supplier/Supplier.aspx'", true);
                    }
                }
            }
        }