Ejemplo n.º 1
0
        protected void rblType_SelectedIndexChanged(object sender, EventArgs e)
        {
            DateTime date     = DateTime.Now;
            string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);

            if (rblType.SelectedItem.Text == "报价")
            {
                if (SheetNums.IsSheetNumOfOP(strtoday))
                {
                    txtSheetNum.Text = SheetNums.SheetNumOfOP("BJ", strtoday);
                }
                else
                {
                    txtSheetNum.Text = "BJ" + strtoday + "001";
                }
            }
            else if (rblType.SelectedItem.Text == "投标")
            {
                if (SheetNums.IsSheetNumOfOP(strtoday))
                {
                    txtSheetNum.Text = SheetNums.SheetNumOfOP("TB", strtoday);
                }
                else
                {
                    txtSheetNum.Text = "TB" + strtoday + "001";
                }
            }
        }
Ejemplo n.º 2
0
        protected void ddlClientType_SelectedIndexChanged(object sender, EventArgs e)
        {
            int    ClientTypeId = Convert.ToInt32(ddlClientType.SelectedValue);
            string preIndex     = string.Empty;

            switch (ddlClientType.SelectedItem.Text)
            {
            case "期货行业": preIndex = "8";
                break;

            case "集成商": preIndex = "7";
                break;

            case "证券行业": preIndex = "6";
                break;

            case "HP客户": preIndex = "5";
                break;
            }

            if (SheetNums.IsSheetNumOfClient(ClientTypeId))
            {
                txtClientNum.Text = SheetNums.SheetNumOfClient(preIndex, ClientTypeId);
            }
            else
            {
                txtClientNum.Text = preIndex + "001";
            }
        }
Ejemplo n.º 3
0
        protected void SheetNum()
        {
            DateTime date     = DateTime.Now;
            string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);

            if (SheetNums.IsSheetNumOfSE(strtoday))
            {
                txtSheetNum.Text = SheetNums.SheetNumOfSE("TF", strtoday);
            }
            else
            {
                txtSheetNum.Text = "TF" + strtoday + "001";
            }
        }
Ejemplo n.º 4
0
        protected void ddlClient_SelectedIndexChanged(object sender, EventArgs e)
        {
            int        ClientId = Convert.ToInt32(ddlClient.SelectedValue);
            ClientInfo client   = new ClientInfo(ClientId);
            string     sheetnum = client.SheetNum.ToString();
            string     strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);

            if (SheetNums.IsSheetNumOfProject())
            {
                lblProjectNum.Text = SheetNums.SheetNumOfProject("XM", sheetnum, strtoday);
            }
            else
            {
                lblProjectNum.Text = "XM" + sheetnum + strtoday + "001";
            }
        }
Ejemplo n.º 5
0
        protected void PageInit()
        {
            lblDepart.Text   = Session["DepartName"].ToString();
            lblEmployee.Text = Session["EmployeeName"].ToString();
            ddlDataBind();

            string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);

            if (SheetNums.IsSheetNumOfCA(strtoday))
            {
                txtSheetNum.Text = SheetNums.SheetNumOfCA("HT", strtoday);
            }
            else
            {
                txtSheetNum.Text = "HT" + strtoday + "001";
            }
        }
Ejemplo n.º 6
0
        protected void ddlAuto_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);

            if (ddlContractType.SelectedItem.Text == "销售合同")
            {
                ClientInfo client = new ClientInfo(Convert.ToInt32(ddlAuto.SelectedValue));
                if (SheetNums.IsNumOfContract(client.ClientName.ToString()))
                {
                    txtContractNum.Text = SheetNums.NumOfContract("XS", client.SheetNum.ToString(), strtoday, client.ClientName.ToString());
                }
                else
                {
                    txtContractNum.Text = "XS" + client.SheetNum.ToString() + strtoday + "001";
                }
            }
            else if (ddlContractType.SelectedItem.Text == "采购合同")
            {
                SupplyInfo supply = new SupplyInfo(Convert.ToInt32(ddlAuto.SelectedValue));
                if (SheetNums.IsNumOfContract(supply.SheetNum.ToString()))
                {
                    txtContractNum.Text = SheetNums.NumOfContract("CG", supply.SheetNum.ToString(), strtoday, supply.SheetNum.ToString());
                }
                else
                {
                    txtContractNum.Text = "CG" + supply.SheetNum.ToString() + strtoday + "001";
                }
            }
            else if (ddlContractType.SelectedItem.Text == "协议")
            {
                SupplyInfo supply   = new SupplyInfo(Convert.ToInt32(ddlAuto.SelectedValue));
                string     sheetnum = supply.SheetNum.ToString();
                if (SheetNums.IsNumOfContract(supply.SheetNum.ToString()))
                {
                    txtContractNum.Text = SheetNums.NumOfContract("XY", sheetnum, strtoday, supply.SheetNum.ToString());
                }
                else
                {
                    txtContractNum.Text = "XY" + supply.SheetNum.ToString() + strtoday + "001";
                }
            }
        }
Ejemplo n.º 7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsPageValid())
            {
                try
                {
                    EmployeeInfo em   = (EmployeeInfo)Session["Employee"];
                    int          emid = Convert.ToInt32(Session["EmployeeId"]);

                    MainBusinessExpInfo main = new MainBusinessExpInfo();
                    main.Save();

                    int             bExpId = Convert.ToInt32(Request["BusinessExpId"].ToString());
                    BusinessExpInfo be     = new BusinessExpInfo(bExpId);
                    be.MainBusinessExpId = main.MainBusinessExpId;

                    DateTime date     = DateTime.Now;
                    string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);
                    be.Today    = strtoday;
                    be.SheetNum = txtSheetNum.Text.ToString();

                    be.ApplyDate   = Convert.ToDateTime(txtApplyDate.Text.ToString());
                    be.ApplyPeople = lblApplyPeople.Text.ToString();
                    be.Depart      = lblDepart.Text.ToString();
                    be.Memo        = txtMemo.Text.ToString();
                    be.ReasonExp   = txtReason.Text.ToString();

                    be.Item1    = txtItem1.Text.ToString();
                    be.Item2    = txtItem2.Text.ToString();
                    be.Item3    = txtItem3.Text.ToString();
                    be.Item4    = txtItem4.Text.ToString();
                    be.Money1   = txtMoney1.Text.ToString();
                    be.Money2   = txtMoney2.Text.ToString();
                    be.Money3   = txtMoney3.Text.ToString();
                    be.Money4   = txtMoney4.Text.ToString();
                    be.MoneySum = txtMoneySum.Text.ToString();

                    string strRoleName = Session["RoleName"].ToString();
                    if (strRoleName == "部门经理")
                    {
                        be.SendEmployeeName = em.EmployeeName;
                        be.SendEmployeeId   = emid;
                        be.PreIsApply       = 1;
                        be.PreIsOver        = 1;
                        be.SignName         = 1;
                    }
                    else
                    {
                        be.PreEmployeeId   = em.EmployeeId;
                        be.PreEmployeeName = em.EmployeeName;
                        be.PreIsApply      = 0;
                        be.PreIsOver       = 0;
                        be.SignName        = 0;
                    }
                    be.IsApply   = 0;
                    be.IsApprove = 0;
                    be.IsApply1  = 0;
                    be.IsApply2  = 0;
                    be.IsOver1   = 0;
                    be.IsOver2   = 0;

                    //GridView嵌套判断
                    be.IsMain      = 1;
                    be.IsMain1     = 1;
                    be.IsMain2     = 1;
                    be.IsMain3     = 1;
                    be.IsNewCreate = 0;
                    be.Save();

                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>");
                    //ClearForms();
                    ViewState["Isbtn"] = "1";
                    txtSheetNum.Text   = SheetNums.SheetNumOfBE("ZDFY", strtoday);
                }
                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true);
                }
            }
        }
Ejemplo n.º 8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsPageValid())
            {
                try
                {
                    int                emid = Convert.ToInt32(Session["EmployeeId"]);
                    EmployeeInfo       em   = (EmployeeInfo)Session["Employee"];
                    MainSpecialExpInfo main = new MainSpecialExpInfo();
                    main.Save();
                    SpecialExpInfo sp = new SpecialExpInfo();
                    sp.MainSpecialExpId = main.MainSpecialExpId;


                    DateTime date     = DateTime.Now;
                    string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);
                    sp.Today = strtoday;

                    sp.SheetNum = txtSheetNum.Text.ToString();

                    sp.ApplyDate   = Convert.ToDateTime(txtApplyDate.Text.ToString());
                    sp.ApplyPeople = lblApplyPeople.Text.ToString();
                    sp.ApplyReason = txtReason.Text.ToString();
                    sp.ApplyMoney  = txtApplyMoney.Text.ToString();

                    if (ddlProject.SelectedValue != "")
                    {
                        sp.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue);
                    }
                    if (ddlProjectStep.SelectedValue.ToString() != "")
                    {
                        sp.ProjectStepId = Convert.ToInt32(ddlProjectStep.SelectedValue);
                    }


                    string strRoleName = Session["RoleName"].ToString();
                    if (strRoleName == "部门经理")
                    {
                        sp.SendEmployeeName = em.EmployeeName;
                        sp.SendEmployeeId   = emid;
                        sp.PreIsApply       = 1;
                        sp.PreIsOver        = 1;
                        sp.SignName         = 1;
                    }
                    else
                    {
                        sp.PreEmployeeId   = em.EmployeeId;
                        sp.PreEmployeeName = em.EmployeeName;
                        sp.PreIsApply      = 0;
                        sp.PreIsOver       = 0;
                        sp.SignName        = 0;
                    }
                    sp.IsApply   = 0;
                    sp.IsApprove = 0;
                    sp.IsApply1  = 0;
                    sp.IsApply2  = 0;
                    sp.IsOver1   = 0;
                    sp.IsOver2   = 0;

                    //GridView嵌套判断
                    sp.IsMain      = 1;
                    sp.IsMain1     = 1;
                    sp.IsMain2     = 1;
                    sp.IsMain3     = 1;
                    sp.IsNewCreate = 0;
                    sp.Save();

                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>");
                    txtSheetNum.Text = SheetNums.SheetNumOfSE("TSFY", strtoday);
                }


                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true);
                }
            }
        }
Ejemplo n.º 9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsPageValid())
            {
                try
                {
                    EmployeeInfo       em     = (EmployeeInfo)Session["Employee"];
                    MainOfferPriceInfo mainop = new MainOfferPriceInfo();
                    mainop.Save();

                    int            OpId = Convert.ToInt32(Request["OfferPriceId"].ToString());
                    OfferPriceInfo op   = new OfferPriceInfo(OpId);
                    op.MainOfferPriceId = mainop.MainOfferPriceId;

                    if (ddlProject.SelectedValue != "")
                    {
                        op.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue);
                    }
                    if (ddlEmployee.SelectedValue != "")
                    {
                        op.EmployeeId = Convert.ToInt32(ddlEmployee.SelectedValue);
                    }

                    op.OfferPriceTypeId = Convert.ToInt32(rblType.SelectedValue);

                    DateTime date     = DateTime.Now;
                    string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);
                    op.Today    = strtoday;
                    op.SheetNum = txtSheetNum.Text.ToString();

                    op.FillTableDate   = Convert.ToDateTime(txtFillTableDate.Text.ToString());
                    op.SectionView     = txtSectionView.Text.ToString();
                    op.SheetNum        = txtSheetNum.Text.ToString();
                    op.ProjectDes      = txtProjectDes.Text.ToString();
                    op.MoneySum        = txtMoneySum.Text.ToString();
                    op.BigMoney        = txtBigMoney.Text.ToString();
                    op.ProductMoneySum = lblMoneySum.Text.ToString();
                    if (UpFile.HasFile == true)
                    {
                        string name        = this.UpFile.FileName;
                        int    startindex  = this.UpFile.FileName.LastIndexOf(@"\") + 1;
                        string fileName    = this.UpFile.FileName.Substring(startindex);
                        string phyFileName = this.Server.MapPath(@"~\Files\" + "OfferPrice") + @"\" + fileName;
                        this.UpFile.SaveAs(phyFileName);

                        OfferFileInfo of = new OfferFileInfo();
                        of.OfferFileName = fileName;                   //文件名
                        of.PhyFileName   = UpFile.PostedFile.FileName; //本地文件路径
                        of.Save();
                        op.OfferFileId = Convert.ToInt32(of.OfferFileId);
                    }

                    op.SendEmployeeName = em.EmployeeName;
                    op.SendEmployeeId   = em.EmployeeId;
                    op.PreIsApply       = 1;
                    op.PreIsOver        = 1;

                    op.IsApply   = 0;
                    op.IsApprove = 0;
                    op.IsApply1  = 0;
                    op.IsApply2  = 0;
                    op.IsOver1   = 0;
                    op.IsOver2   = 0;

                    //GridView嵌套判断
                    op.IsMain      = 1;
                    op.IsMain1     = 1;
                    op.IsMain2     = 1;
                    op.IsMain3     = 1;
                    op.IsNewCreate = 0;
                    op.IsSignName  = 0;
                    op.Save();

                    if (UpFile.HasFile)
                    {
                        ////文件上传地址根目录,这里通过IIS架设本地主机为FTP服务器
                        //string FileSaveUri = @"ftp://192.168.11.70/www/Files/OfferPrice/";
                        ////FTP用户名密码,就是本机的用户名密码
                        //string ftpUser = "******";
                        //string ftpPassWord = "******";
                        //SendFiles(FileSaveUri, ftpUser, ftpPassWord);
                        this.UpFile.PostedFile.SaveAs(Server.MapPath("~/Files/OfferPrice/" + UpFile.FileName));
                    }

                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>");

                    ViewState["Isbtn"] = "1";
                    txtSheetNum.Text   = SheetNums.SheetNumOfOP("BJTB", strtoday);
                    gvProductInitBind();
                }
                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true);
                }
            }
        }