Esempio n. 1
0
    protected void grid_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "OK")
        {
            ASPxComboBox   cmb_JobType    = ASPxPopupControl1.FindControl("cmb_JobType") as ASPxComboBox;
            ASPxButtonEdit txt_CustomerId = ASPxPopupControl1.FindControl("txt_CustomerId") as ASPxButtonEdit;
            ASPxDateEdit   issueDate      = ASPxPopupControl1.FindControl("date_IssueDate") as ASPxDateEdit;
            if (txt_CustomerId.Text.Trim() == "" && txt_CustomerName.Text.Trim() == "")
            {
                e.Result = "Fail! Please enter the Customer";
                return;
            }
            if (cmb_JobType.Text.Trim() == "")
            {
                e.Result = "Fail! Please enter the JobType";
                return;
            }
            else
            {
                e.Result = SaveNewJob();
            }
        }
    }
Esempio n. 2
0
    protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            C2.bill_doc  inv           = new C2.bill_doc();
            ASPxComboBox txtCustomerId = ASPxPopupControl1.FindControl("cmb_Customer") as ASPxComboBox;
            ASPxDateEdit txtDocDt      = ASPxPopupControl1.FindControl("txt_DocDt") as ASPxDateEdit;
            ASPxComboBox txtTermId     = ASPxPopupControl1.FindControl("txt_TermId") as ASPxComboBox;

            string counterType = "AR-SIN";

            inv.DocType = "SIN";
            inv.DocDate = txtDocDt.Date;
            string invN = C2Setup.GetNextNo(inv.DocType, counterType, inv.DocDate);
            inv.DocNo   = invN;
            inv.PartyTo = SafeValue.SafeString(txtCustomerId.Value, "");
            string[] currentPeriod = EzshipHelper.GetAccPeriod(txtDocDt.Date);

            inv.AcYear   = SafeValue.SafeInt(currentPeriod[1], txtDocDt.Date.Year);
            inv.AcPeriod = SafeValue.SafeInt(currentPeriod[0], txtDocDt.Date.Month);
            inv.Term     = txtTermId.Text;
            //
            int dueDay = SafeValue.SafeInt(txtTermId.Text.ToUpper().Replace("DAYS", "").Trim(), 0);
            inv.DocDueDate = inv.DocDate.AddDays(dueDay);//SafeValue.SafeDate(dueDt.Text, DateTime.Now);

            inv.AcCode   = EzshipHelper.GetAccArCode(inv.PartyTo, inv.CurrencyId);;
            inv.AcSource = "DB";

            inv.MastRefNo  = "0";
            inv.JobRefNo   = "0";
            inv.MastType   = "";
            inv.ExportInd  = "N";
            inv.UserId     = HttpContext.Current.User.Identity.Name;
            inv.EntryDate  = DateTime.Now;
            inv.CancelDate = new DateTime(1900, 1, 1);
            inv.CancelInd  = "N";
            try
            {
                C2.Manager.ORManager.StartTracking(inv, Wilson.ORMapper.InitialState.Inserted);
                C2.Manager.ORManager.PersistChanges(inv);
                C2Setup.SetNextNo("", counterType, invN, inv.DocDate);
            }
            catch
            {
            }
            e.Result = invN;
            //ClientScriptManager cs = Page.ClientScript;
            //cs.RegisterStartupScript(this.GetType(), "", "<script type=\"text/javascript\">txt_Remark.SetText();cmb_PackType.SetText();spin_Pkgs.SetText();spin_Volume.SetText();spin_Weight.SetText();cmb_Carrier.SetText();cmb_Customer.SetText();cbx_jobCate.SetText();ASPxPopupClientControl.Hide();parent.navTab.openTab(\"" + order.JobNo + "\",\"/Z/job_edit.aspx?id=" + order.SequenceId + "\"" + ",{title:\"" + order.JobNo + "\", fresh:false, external:true});</script>");
        }
    }
Esempio n. 3
0
    protected string SaveNewJob()
    {
        try
        {
            ASPxDateEdit issueDate = ASPxPopupControl1.FindControl("date_IssueDate") as ASPxDateEdit;
            string       issueN    = "";
            JobInfo      job       = new JobInfo();
            issueN      = C2Setup.GetNextNo("", "JobOrder", issueDate.Date);
            job.JobDate = issueDate.Date;

            job.JobStage = "Customer Inquir";
            ASPxComboBox cmb_JobType = ASPxPopupControl1.FindControl("cmb_JobType") as ASPxComboBox;
            job.JobType = SafeValue.SafeString(cmb_JobType.Value);
            //Main Info
            ASPxButtonEdit txt_CustomerId = ASPxPopupControl1.FindControl("txt_CustomerId") as ASPxButtonEdit;
            job.CustomerId = txt_CustomerId.Text;
            ASPxTextBox txt_CustomerName = ASPxPopupControl1.FindControl("txt_CustomerName") as ASPxTextBox;
            job.CustomerName = txt_CustomerName.Text;
            ASPxMemo memo_Address = ASPxPopupControl1.FindControl("memo_NewAddress") as ASPxMemo;
            job.CustomerAdd = memo_Address.Text;

            ASPxTextBox txt_PostalCode = ASPxPopupControl1.FindControl("txt_NewPostalCode") as ASPxTextBox;
            job.Postalcode = txt_PostalCode.Text;
            ASPxTextBox txt_Contact = ASPxPopupControl1.FindControl("txt_NewContact") as ASPxTextBox;
            job.Contact = txt_Contact.Text;
            ASPxTextBox txt_Tel = ASPxPopupControl1.FindControl("txt_NewTel") as ASPxTextBox;
            job.Tel = txt_Tel.Text;
            ASPxTextBox txt_Email = ASPxPopupControl1.FindControl("txt_NewEmail") as ASPxTextBox;
            job.Email = txt_Email.Text;
            ASPxTextBox txt_Fax = ASPxPopupControl1.FindControl("txt_NewFax") as ASPxTextBox;
            job.Fax = txt_Fax.Text;
            ASPxMemo remark = ASPxPopupControl1.FindControl("txt_NewRemark") as ASPxMemo;
            job.Remark     = remark.Text;
            job.WorkStatus = "PENDING";

            string userId = HttpContext.Current.User.Identity.Name;

            job.CreateBy       = userId;
            job.CreateDateTime = DateTime.Now;
            job.UpdateBy       = userId;
            job.UpdateDateTime = DateTime.Now;
            job.JobNo          = issueN;
            Manager.ORManager.StartTracking(job, Wilson.ORMapper.InitialState.Inserted);
            Manager.ORManager.PersistChanges(job);
            C2Setup.SetNextNo("", "JobOrder", issueN, issueDate.Date);

            return(job.JobNo);
        }
        catch { }
        return("");
    }
Esempio n. 4
0
    protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            C2.rate_doc  inv           = new C2.rate_doc();
            ASPxComboBox txtCustomerId = ASPxPopupControl1.FindControl("cmb_Customer") as ASPxComboBox;
            ASPxDateEdit txtDocDt      = ASPxPopupControl1.FindControl("txt_DocDt") as ASPxDateEdit;
            ASPxComboBox txtTermId     = ASPxPopupControl1.FindControl("txt_TermId") as ASPxComboBox;

            string counterType = "AR-SQU";

            inv.DocType = "SQU";
            inv.DocDate = txtDocDt.Date;
            string invN = C2Setup.GetNextNo(inv.DocType, counterType, inv.DocDate);
            inv.DocNo   = invN;
            inv.PartyTo = SafeValue.SafeString(txtCustomerId.Value, "");
            string[] currentPeriod = EzshipHelper.GetAccPeriod(txtDocDt.Date);

            inv.AcYear   = SafeValue.SafeInt(currentPeriod[1], txtDocDt.Date.Year);
            inv.AcPeriod = SafeValue.SafeInt(currentPeriod[0], txtDocDt.Date.Month);
            inv.Term     = txtTermId.Text;
            //
            int dueDay = SafeValue.SafeInt(txtTermId.Text.ToUpper().Replace("DAYS", "").Trim(), 0);
            inv.DocDueDate = inv.DocDate.AddDays(dueDay);//SafeValue.SafeDate(dueDt.Text, DateTime.Now);

            inv.AcCode   = EzshipHelper.GetAccArCode(inv.PartyTo, inv.CurrencyId);;
            inv.AcSource = "DB";

            inv.MastRefNo  = "0";
            inv.JobRefNo   = "0";
            inv.MastType   = "";
            inv.ExportInd  = "N";
            inv.UserId     = HttpContext.Current.User.Identity.Name;
            inv.EntryDate  = DateTime.Now;
            inv.CancelDate = new DateTime(1900, 1, 1);
            inv.CancelInd  = "N";
            try
            {
                C2.Manager.ORManager.StartTracking(inv, Wilson.ORMapper.InitialState.Inserted);
                C2.Manager.ORManager.PersistChanges(inv);
                C2Setup.SetNextNo("", counterType, invN, inv.DocDate);
            }
            catch
            {
            }
            e.Result = invN;
        }
    }
Esempio n. 5
0
        void cbGCH_SelectedIndexChanged(object sender, EventArgs e)
        {
            ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox;

            cbGZH.DataSource = new List <ProjectDetailEntity>();

            ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox;

            if (cbGCH.SelectedIndex < 0)
            {
                return;
            }
            string gch = cbGCH.SelectedItem.Value.ToString();

            if (cbGZH != null)
            {
                cbGZH.DataSource = ProjectFactory.GetDetailsByProjectCode(gch);
                cbGZH.TextField  = "WORK_CODE";
                cbGZH.ValueField = "WORK_CODE";
                cbGZH.DataBind();
            }

            //throw new NotImplementedException();
        }
Esempio n. 6
0
    protected void ASPxGridView1_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            C2.jnl_doc   inv               = new C2.jnl_doc();
            ASPxComboBox txtCustomerId     = ASPxPopupControl1.FindControl("cmb_Customer") as ASPxComboBox;
            ASPxDateEdit txtDocDt          = ASPxPopupControl1.FindControl("txt_DocDt") as ASPxDateEdit;
            ASPxTextBox  txtAcDorc         = ASPxPopupControl1.FindControl("txt_AcDorc") as ASPxTextBox;
            ASPxComboBox cboDocType        = ASPxPopupControl1.FindControl("cbo_DocType") as ASPxComboBox;
            ASPxComboBox cboDocType1       = ASPxPopupControl1.FindControl("cbo_DocType1") as ASPxComboBox;
            ASPxTextBox  txtOtherPartyName = ASPxPopupControl1.FindControl("txt_OtherPartyName") as ASPxTextBox;

            inv.PartyTo = SafeValue.SafeString(txtCustomerId.Value, "");
            //inv.DocNo = invN;
            inv.DocType     = cboDocType.Text;
            inv.DocType1    = cboDocType1.Text;
            inv.DocDate     = txtDocDt.Date;
            inv.ChqDate     = txtDocDt.Date;
            inv.AcCode      = System.Configuration.ConfigurationManager.AppSettings["DefaultBankCode"];
            inv.DocCurrency = System.Configuration.ConfigurationManager.AppSettings["Currency"];
            inv.DocExRate   = new decimal(1.0);
            inv.ExportInd   = "N";

            if (inv.DocType1.ToLower() == "refund")
            {
                inv.AcSource = "CR";
            }
            else
            {
                inv.AcSource = "DB";
            }

            inv.DocAmt         = 0;
            inv.LocAmt         = 0;
            inv.CancelDate     = new DateTime(1900, 1, 1);
            inv.CancelInd      = "N";
            inv.BankRec        = "N";
            inv.BankDate       = new DateTime(1900, 1, 1);
            inv.OtherPartyName = txtOtherPartyName.Text;
            string[] currentPeriod = EzshipHelper.GetAccPeriod(txtDocDt.Date);
            inv.AcYear   = SafeValue.SafeInt(currentPeriod[1], txtDocDt.Date.Year);
            inv.AcPeriod = SafeValue.SafeInt(currentPeriod[0], txtDocDt.Date.Month);
            try
            {
                inv.GenerateInd    = "N";
                inv.CreateBy       = HttpContext.Current.User.Identity.Name;
                inv.CreateDateTime = DateTime.Now;
                inv.UpdateBy       = HttpContext.Current.User.Identity.Name;
                inv.UpdateDateTime = DateTime.Now;
                inv.PostBy         = "";
                inv.PostDateTime   = new DateTime(1900, 1, 1);
                C2.Manager.ORManager.StartTracking(inv, Wilson.ORMapper.InitialState.Inserted);
                C2.Manager.ORManager.PersistChanges(inv);
                inv.DocNo = inv.Id.ToString();
                C2.Manager.ORManager.StartTracking(inv, Wilson.ORMapper.InitialState.Updated);
                C2.Manager.ORManager.PersistChanges(inv);
                //C2Setup.SetNextNo("AR-RECEIPT", invN);
            }
            catch
            {
            }
            e.Result = inv.DocNo;
        }
    }
Esempio n. 7
0
    protected void grid1_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            C2.JobOrder  order         = new C2.JobOrder();
            ASPxComboBox txt_JobType   = ASPxPopupControl1.FindControl("txt_JobType") as ASPxComboBox;
            ASPxComboBox cbx_jobCate   = ASPxPopupControl1.FindControl("cbx_jobCate") as ASPxComboBox;
            ASPxComboBox txtCustomerId = ASPxPopupControl1.FindControl("cmb_Customer") as ASPxComboBox;
            ASPxComboBox txtShipperId  = ASPxPopupControl1.FindControl("cmb_Carrier") as ASPxComboBox;
            //ASPxTextBox txtShipperName = ASPxPopupControl1.FindControl("txtShipperName") as ASPxTextBox;
            ASPxMemo     txt_Remark  = ASPxPopupControl1.FindControl("txt_Remark") as ASPxMemo;
            ASPxSpinEdit spin_Weight = ASPxPopupControl1.FindControl("spin_Weight") as ASPxSpinEdit;
            ASPxSpinEdit spin_Volume = ASPxPopupControl1.FindControl("spin_Volume") as ASPxSpinEdit;
            ASPxSpinEdit spin_Pkgs   = ASPxPopupControl1.FindControl("spin_Pkgs") as ASPxSpinEdit;
            ASPxComboBox txt_pkgType = ASPxPopupControl1.FindControl("cmb_PackType") as ASPxComboBox;
            string       refType     = "SEF";
            string       runType     = "EXPORTREF";//SEF/SEL/SEC/ SCF/SCL/SCC/ SAE/SAC/SLT
            //if (refType == "SAE")
            //    runType = "AirExport";
            //else if (refType == "SAC")
            //    runType = "AirCrossTrade";
            //else if (refType == "SCF" || refType == "SCL" || refType == "SCC")
            //    runType = "SeaCrossTrade";
            //else if (refType == "SLT")
            //    runType = "LocalTpt";
            order.JobNo       = C2Setup.GetNextNo(refType, runType, DateTime.Today);
            order.RefNo       = order.JobNo;
            order.Note1       = txt_JobType.Text;
            order.Note2       = cbx_jobCate.Text;
            order.CustomerId  = SafeValue.SafeString(txtCustomerId.Value);
            order.ShipperId   = SafeValue.SafeString(txtShipperId.Value);
            order.ShipperName = txtShipperId.Text;
            order.Remark      = txt_Remark.Text;
            order.JobDate     = DateTime.Today;
            C2.Manager.ORManager.StartTracking(order, Wilson.ORMapper.InitialState.Inserted);
            C2.Manager.ORManager.PersistChanges(order);
            C2Setup.SetNextNo(refType, runType, order.JobNo, DateTime.Today);

            C2.JobCargo cargo = new C2.JobCargo();
            cargo.RefNo       = order.JobNo;
            cargo.Weight      = SafeValue.SafeDecimal(spin_Weight.Value, 0);
            cargo.Volume      = SafeValue.SafeDecimal(spin_Volume.Value, 0);
            cargo.Qty         = SafeValue.SafeInt(spin_Pkgs.Value, 0);
            cargo.PackageType = txt_pkgType.Text;
            cargo.Remark      = "";
            C2.Manager.ORManager.StartTracking(cargo, Wilson.ORMapper.InitialState.Inserted);
            C2.Manager.ORManager.PersistChanges(cargo);

            EzshipLog.Log(order.JobNo, order.JobNo, "Direct", "Create");

            ASPxPopupControl1.ShowOnPageLoad = false;
            cbx_jobCate.Text   = "";
            txtCustomerId.Text = "";
            txtShipperId.Text  = "";
            txt_Remark.Text    = "";
            spin_Weight.Text   = "";
            spin_Volume.Text   = "";
            spin_Pkgs.Text     = "";
            txt_pkgType.Text   = "";
            e.Result           = order.SequenceId + "|" + order.JobNo;
            //ClientScriptManager cs = Page.ClientScript;
            //cs.RegisterStartupScript(this.GetType(), "", "<script type=\"text/javascript\">txt_Remark.SetText();cmb_PackType.SetText();spin_Pkgs.SetText();spin_Volume.SetText();spin_Weight.SetText();cmb_Carrier.SetText();cmb_Customer.SetText();cbx_jobCate.SetText();ASPxPopupClientControl.Hide();parent.navTab.openTab(\"" + order.JobNo + "\",\"/Z/job_edit.aspx?id=" + order.SequenceId + "\"" + ",{title:\"" + order.JobNo + "\", fresh:false, external:true});</script>");
        }
    }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            user = Session["theUserManager"] as userManager;


            if (user == null)
            {
                Response.End();
            }


            userManager theUserManager = (userManager)Session["theUserManager"];
            string      theCompanyCode = theUserManager.getCompanyCode();
            string      theUserId      = theUserManager.getUserId();

            List <WorkShopEntity> workShop = WorkShopFactory.GetUserWorkShops(theUserId);

            //ASPxGridView1.CustomColumnDisplayText += new DevExpress.Web.ASPxGridView.ASPxGridViewColumnDisplayTextEventHandler(ASPxGridView1_CustomColumnDisplayText);
            GridViewDataComboBoxColumn column1 = (ASPxGridView1.Columns["LLXZZZ"] as GridViewDataComboBoxColumn);
            {
                column1.PropertiesComboBox.DataSource = UserFactory.GetAll();
                column1.PropertiesComboBox.ValueField = "USER_CODE";
                column1.PropertiesComboBox.TextField  = "USER_NAME";
            }
            GridViewDataComboBoxColumn column2 = (ASPxGridView1.Columns["LLZPXZ"] as GridViewDataComboBoxColumn);
            {
                column2.PropertiesComboBox.DataSource = TeamFactory.GetByWorkShopID("CK_WS01");
                column2.PropertiesComboBox.ValueField = "RMES_ID";
                column2.PropertiesComboBox.TextField  = "TEAM_NAME";
            }
            GridViewDataComboBoxColumn column3 = (ASPxGridView1.Columns["LLBS"] as GridViewDataComboBoxColumn);
            {
                System.Data.DataTable dt = new System.Data.DataTable();
                dt.Columns.Add("value");
                dt.Columns.Add("text");
                dt.Rows.Add("W", "新建");
                dt.Rows.Add("N", "已发库房");
                dt.Rows.Add("Y", "已领料");
                dt.Rows.Add("E", "无价格");
                column3.PropertiesComboBox.DataSource = dt;
                column3.PropertiesComboBox.ValueField = "value";
                column3.PropertiesComboBox.TextField  = "text";
            }


            List <InterIssueEntity> allEntity = InterIssueFactory.GetByWorkShopCode("8101-B1");

            GridViewDataComboBoxColumn colGZH = (ASPxGridView1.Columns["LLGZH"] as GridViewDataComboBoxColumn);
            var a = ((from s in allEntity where !string.IsNullOrWhiteSpace(s.LLGZH) select s.LLGZH).Distinct()).ToList <string>();

            colGZH.PropertiesComboBox.DataSource = a;

            GridViewDataComboBoxColumn colGCH = (ASPxGridView1.Columns["LLGCH"] as GridViewDataComboBoxColumn);
            var b = (from s in allEntity select s.LLGCH).Distinct().ToList <string>();;

            colGCH.PropertiesComboBox.DataSource = b;

            GridViewDataComboBoxColumn colZJDH = (ASPxGridView1.Columns["LLZJDH"] as GridViewDataComboBoxColumn);
            var c = (from s in allEntity select s.LLZJDH).Distinct().ToList <string>();

            for (int i = 0; i < c.Count; i++)
            {
                if (c[i] == null)
                {
                    c[i] = "";
                }
            }
            colZJDH.PropertiesComboBox.DataSource = c;

            DataTable d = new DataTable();

            d.Columns.Add("LLGCH");
            d.Columns.Add("LLGZH");
            d.Columns.Add("LLZJDH");
            d.Columns.Add("LLXMDH");
            d.Columns.Add("LLXMMC");
            d.Columns.Add("LLSL");
            d.Columns.Add("YSSL");
            d.Columns.Add("LLRQ");
            d.Columns.Add("LLCJRQ");
            d.Columns.Add("LLZPXZ");
            d.Columns.Add("LLXZZZ");
            d.Columns.Add("PLAN_CODE");
            d.Columns.Add("LLBS");
            d.Columns.Add("TMBH");

            foreach (InterIssueEntity i in allEntity)
            {
                List <IssueReceivedEntity> rs = IssueReceivedFactory.GetByDetailCode(i.TMBH);
                float sum = 0;
                foreach (IssueReceivedEntity r in rs)
                {
                    sum += (int)r.ITEM_QTY;
                }
                d.Rows.Add(i.LLGCH, i.LLGZH, i.LLZJDH, i.LLXMDH, i.LLXMMC, i.LLSL, sum, i.LLRQ, i.LLCJRQ, i.LLZPXZ, i.LLXZZZ, i.PLAN_CODE, i.LLBS, i.TMBH);
            }

            ASPxGridView1.DataSource = d;
            ASPxGridView1.DataBind();
            //用后台的配置开关,设置是否允许手动添加要料单,在code_config_system中
            if (DB.ReadConfigServer("INV2300_ALLOW_MANUAL_ADD").Equals("FALSE"))
            {
                btnNewBill.Visible = false;
            }
            else
            {
                btnNewBill.Visible = true;
                ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox;
                if (cbGCH != null)
                {
                    List <WorkShopEntity> workshops = WorkShopFactory.GetUserWorkShops(user.getUserId());
                    List <ProjectEntity>  projects  = new List <ProjectEntity>();
                    foreach (WorkShopEntity w in workshops)
                    {
                        projects.AddRange(ProjectFactory.GetByWorkShop(w.RMES_ID));
                    }
                    foreach (ProjectEntity p in projects)
                    {
                        cbGCH.Items.Add(p.PROJECT_CODE + " | " + p.PROJECT_NAME, p.PROJECT_CODE);
                    }
                    cbGCH.ClientSideEvents.SelectedIndexChanged = "function(s,e){ initWorkCode(s.GetValue().toString());}";
                    ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox;
                    if (cbGZH != null)
                    {
                        cbGZH.Callback += new DevExpress.Web.ASPxClasses.CallbackEventHandlerBase(cbGZH_Callback);
                    }
                    cbGCH.SelectedIndexChanged += new EventHandler(cbGCH_SelectedIndexChanged);
                }
                ASPxComboBox cbTeam = ASPxPopupControl1.FindControl("LLZPXZ") as ASPxComboBox;
                if (cbTeam != null)
                {
                    List <TeamEntity> teams = TeamFactory.GetByUserID(user.getUserId());
                    foreach (TeamEntity t in teams)
                    {
                        cbTeam.Items.Add(t.TEAM_NAME, t.TEAM_CODE);
                    }
                }
            }
        }
Esempio n. 9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox;

            if (cbGCH == null)
            {
                return;
            }
            ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox;

            if (cbGZH == null)
            {
                return;
            }
            ASPxTextBox txtPGDH = ASPxPopupControl1.FindControl("LLPGDH") as ASPxTextBox;

            if (txtPGDH == null)
            {
                return;
            }
            ASPxTextBox txtXMDH = ASPxPopupControl1.FindControl("LLXMDH") as ASPxTextBox;

            if (txtXMDH == null)
            {
                return;
            }
            ASPxTextBox txtXMMC = ASPxPopupControl1.FindControl("LLXMMC") as ASPxTextBox;

            if (txtXMMC == null)
            {
                return;
            }
            ASPxTextBox txtLLSL = ASPxPopupControl1.FindControl("LLSL") as ASPxTextBox;

            if (txtLLSL == null)
            {
                return;
            }
            ASPxComboBox cbTEAM = ASPxPopupControl1.FindControl("LLZPXZ") as ASPxComboBox;

            if (cbTEAM == null)
            {
                return;
            }
            ASPxDateEdit cbLLRQ = ASPxPopupControl1.FindControl("LYRQ") as ASPxDateEdit;

            if (cbLLRQ == null)
            {
                return;
            }
            ASPxTextBox txtXMLX = ASPxPopupControl1.FindControl("LLXMLX") as ASPxTextBox;

            if (txtXMLX == null)
            {
                return;
            }

            string     project_code = cbGCH.SelectedItem.Value.ToString();
            string     work_code    = cbGZH.SelectedItem.Value.ToString();
            string     billno       = txtPGDH.Text;
            string     item_code    = txtXMDH.Text;
            string     item_name    = txtXMMC.Text;
            int        item_qty     = Convert.ToInt32(txtLLSL.Text);
            string     team_cdoe    = cbTEAM.SelectedItem.Value.ToString();
            string     llxmlx       = txtXMLX.Text;
            DateTime   need_date    = cbLLRQ.Date;
            UserEntity u            = UserFactory.GetByID(user.getUserId());
            TeamEntity t            = TeamFactory.GetByTeamCode(team_cdoe);
            UserEntity leader       = UserFactory.GetByUserCode(t.LEADER_CODE);

            if (string.IsNullOrWhiteSpace(project_code) || string.IsNullOrWhiteSpace(work_code) || string.IsNullOrWhiteSpace(billno) ||
                string.IsNullOrWhiteSpace(item_code) || string.IsNullOrWhiteSpace(team_cdoe) || string.IsNullOrWhiteSpace(item_name) ||
                string.IsNullOrWhiteSpace(llxmlx))
            {
                return;
            }
            if (item_qty < 1 || item_qty > 999999)
            {
                return;
            }
            if ((need_date - DateTime.Now).TotalMinutes < 0)
            {
                return;
            }

            ProjectEntity         project   = ProjectFactory.GetByProjectCode(project_code);
            List <WorkShopEntity> workshops = WorkShopFactory.GetUserWorkShops(user.getUserId());

            if (workshops.Count > 0)
            {
                workshop = workshops[0];
            }
            else
            {
                return;
            }

            if (project != null)
            {
                string barCode = DB.GetInstance().ExecuteScalar <string>("select 'RMESL'||TRIM(TO_CHAR(SEQ_ISSUE_BARCODE.NEXTVAL,'0000000000')) from dual");

                InterIssueEntity interEntity = new InterIssueEntity
                {
                    LLGCH     = project_code,                    //领料合同号
                    LLGZH     = work_code,                       //领料工作号
                    LLCPXH    = project.PRODUCT_SERIES,          //领料产品型号
                    LLZJDH    = "MANUAL",                        //领料组件代号
                    PLAN_CODE = "R" + billno,                    //领料派工单号 - 临改单
                    LLLYDW    = workshop.WORKSHOP_CODE,          //领用单位 - 车间
                    LLZPXZ    = team_cdoe,                       //装配小组
                    LLXH      = 1,                               //领料序号
                    LLXMDH    = item_code,                       //项目代号 - 图号
                    LLLYPC    = "1",                             //领用批次
                    LLSL      = item_qty,                        //领料数量
                    LLCJYH    = u.USER_CODE + "/" + u.USER_NAME, //单据创建人
                    LLCJRQ    = DateTime.Now,                    //单据创建日期
                    LLNY      = need_date.ToString("yyMM"),      //领料年月
                    LLRQ      = need_date,                       //领料日期
                    LLXMMC    = item_name,                       //领料项目名称
                    TMBH      = barCode,                         //领料条码编号
                    LLBS      = "W",                             //领料标识
                    LLXZZZ    = leader.USER_CODE + "/" + leader.USER_NAME,
                    LLSPYH    = u.USER_CODE + "/" + u.USER_NAME,
                    LLR       = leader.USER_CODE + "/" + leader.USER_NAME,
                    LLXMLX    = llxmlx.ToUpper()
                };
                object obj = DB.GetInstance().Insert("INTER_ISSUE", "", false, interEntity);
                if (obj.ToString().ToUpper().Equals("TRUE"))
                {
                    Response.Write("<script>alert('添加成功!');</script>");
                    Response.Redirect(Request.Url.ToString());
                }
            }
        }
Esempio n. 10
0
    protected string SaveNewJob()
    {
        try
        {
            ASPxDateEdit issueDate = ASPxPopupControl1.FindControl("date_IssueDate") as ASPxDateEdit;
            string       issueN    = "";
            JobInfo      job       = new JobInfo();
            DateTime     dt        = DateTime.Now;
            if (issueDate.Date.IsDaylightSavingTime())
            {
                dt = issueDate.Date;
            }
            issueN        = C2Setup.GetNextNo("", "Quotation", dt);
            job.JobDate   = dt;
            job.DateTime1 = dt;
            job.Attribute = "Job";

            ASPxComboBox cmb_JobType = ASPxPopupControl1.FindControl("cmb_JobType") as ASPxComboBox;
            job.JobType          = SafeValue.SafeString(cmb_JobType.Value);
            job.JobStage         = SafeValue.SafeString(cmb_JobType.Value);
            job.Mode             = "LOCAL";
            job.ViaWh            = "N/A";
            job.Item1            = "Yes";
            job.Item2            = "Yes";
            job.Currency         = "SGD";
            job.ExRate           = 1;
            job.StorageStartDate = new DateTime(1900, 1, 1);
            job.StorageFreeDays  = 0;            //new DateTime(1900,1,1);
            string sql     = string.Format(@"select Id from JobInfo where Attribute='Temp'");
            string id      = "";
            string jobType = "";
            if (job.JobType == "Haulier")
            {
                issueN    = "Q-H-" + issueN;
                job.ViaWh = "Normal";
                jobType   = "'HTemp'";
                sql      += " and JobType=" + jobType;
                id        = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));
            }
            if (job.JobType == "Transport")
            {
                issueN     = "Q-T-" + issueN;
                job.Mode   = "LCL";
                job.Note27 = "3% of declared value";
                job.Note28 = "+0.25% additional";
                job.Note29 = "+0.25% additional";
                job.Note30 = "+0.5 % additional per month";
                job.Note23 = "By Sea";
                job.Note24 = "Weekly";

                jobType = "'TTemp'";
                sql    += " and JobType=" + jobType;
                id      = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));
            }
            if (job.JobType == "Freight")
            {
                issueN  = "Q-F-" + issueN;
                jobType = "'FTemp'";
                sql    += " and JobType=" + jobType;
                id      = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));
            }
            if (job.JobType == "Warehouse")
            {
                issueN  = "Q-W-" + issueN;
                jobType = "WTemp'";
                sql    += " and JobType=" + jobType;
                id      = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));
            }
            //Main Info
            Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(JobInfo), "Id='" + id + "'");
            JobInfo        jobTemp           = C2.Manager.ORManager.GetObject(query) as JobInfo;
            ASPxButtonEdit txt_CustomerId    = ASPxPopupControl1.FindControl("txt_CustomerId") as ASPxButtonEdit;
            job.CustomerId = txt_CustomerId.Text;
            ASPxTextBox txt_CustomerName = ASPxPopupControl1.FindControl("txt_CustomerName") as ASPxTextBox;
            job.CustomerName = txt_CustomerName.Text;
            ASPxMemo memo_Address = ASPxPopupControl1.FindControl("memo_NewAddress") as ASPxMemo;
            job.CustomerAdd = memo_Address.Text;
            job.OriginAdd   = memo_Address.Text;

            ASPxTextBox txt_PostalCode = ASPxPopupControl1.FindControl("txt_NewPostalCode") as ASPxTextBox;
            job.Postalcode = txt_PostalCode.Text;
            ASPxTextBox txt_Contact = ASPxPopupControl1.FindControl("txt_NewContact") as ASPxTextBox;
            job.Contact = txt_Contact.Text;
            ASPxTextBox txt_Tel = ASPxPopupControl1.FindControl("txt_NewTel") as ASPxTextBox;
            job.Tel = txt_Tel.Text;
            ASPxTextBox txt_Email = ASPxPopupControl1.FindControl("txt_NewEmail") as ASPxTextBox;
            job.Email = txt_Email.Text;
            ASPxTextBox txt_Fax = ASPxPopupControl1.FindControl("txt_NewFax") as ASPxTextBox;
            job.Fax = txt_Fax.Text;
            ASPxMemo remark = ASPxPopupControl1.FindControl("txt_NewRemark") as ASPxMemo;
            job.DestinationAdd = remark.Text;
            job.WorkStatus     = "Pending";
            if (jobTemp != null)
            {
                job.PayTerm          = jobTemp.PayTerm;
                job.Currency         = jobTemp.Currency;
                job.ExRate           = jobTemp.ExRate;
                job.ExpiryDate       = jobTemp.ExpiryDate;
                job.WareHouseId      = jobTemp.WareHouseId;
                job.Volumne          = jobTemp.Volumne;
                job.VolumneRmk       = jobTemp.VolumneRmk;
                job.Remark           = jobTemp.Remark;
                job.TripNo           = jobTemp.TripNo;
                job.HeadCount        = jobTemp.HeadCount;
                job.TruckNo          = jobTemp.TruckNo;
                job.PackRmk          = jobTemp.PackRmk;
                job.MoveRmk          = jobTemp.MoveRmk;
                job.ViaWh            = jobTemp.ViaWh;
                job.ItemDes          = jobTemp.ItemDes;
                job.ServiceType      = jobTemp.ServiceType;
                job.StorageFreeDays  = jobTemp.StorageFreeDays;
                job.StorageTotalDays = jobTemp.StorageTotalDays;
                job.Item1            = jobTemp.Item1;
                job.Item2            = jobTemp.Item2;
                job.ItemDetail1      = jobTemp.ItemDetail1;
                job.ItemDetail2      = jobTemp.ItemDetail2;

                job.Item3      = jobTemp.Item3;
                job.ItemValue3 = jobTemp.ItemValue3;
                job.ItemData3  = jobTemp.ItemData3;
                job.ItemPrice3 = jobTemp.ItemPrice3;

                job.Item4       = jobTemp.Item4;
                job.ItemDetail4 = jobTemp.ItemDetail4;
                job.ItemPrice4  = jobTemp.ItemPrice4;

                job.Item5      = jobTemp.Item5;
                job.ItemValue5 = jobTemp.ItemValue5;
                job.ItemPrice5 = jobTemp.ItemPrice5;

                job.Item6       = jobTemp.Item6;
                job.ItemDetail6 = jobTemp.ItemDetail6;
                job.ItemPrice6  = jobTemp.ItemPrice6;;

                job.Item7       = jobTemp.Item7;
                job.ItemValue7  = jobTemp.ItemValue7;
                job.ItemDetail7 = jobTemp.ItemDetail7;
                job.ItemPrice7  = jobTemp.ItemPrice7;

                job.Item8       = jobTemp.Item8;
                job.ItemValue8  = jobTemp.ItemValue8;
                job.ItemDetail8 = jobTemp.ItemDetail8;
                job.ItemPrice8  = jobTemp.ItemPrice8;

                job.Item9       = jobTemp.Item9;
                job.ItemValue9  = jobTemp.ItemValue9;
                job.ItemDetail9 = jobTemp.ItemDetail9;
                job.ItemPrice9  = jobTemp.ItemPrice9;

                job.Item10       = jobTemp.Item10;
                job.ItemValue10  = jobTemp.ItemValue10;
                job.ItemDetail10 = jobTemp.ItemDetail10;
                job.ItemPrice10  = jobTemp.ItemPrice10;

                job.Item11       = jobTemp.Item11;
                job.ItemDetail11 = jobTemp.ItemDetail11;

                job.Item12       = jobTemp.Item12;
                job.ItemDetail12 = jobTemp.ItemDetail12;

                job.Item13      = jobTemp.Item13;
                job.ItemValue13 = jobTemp.ItemValue13;
                job.ItemData13  = jobTemp.ItemData13;

                job.Item14       = jobTemp.Item14;
                job.ItemValue14  = jobTemp.ItemValue14;
                job.ItemDetail14 = jobTemp.ItemDetail14;
                job.ItemPrice14  = jobTemp.ItemPrice14;

                job.Answer1    = jobTemp.Answer1;
                job.Answer2    = jobTemp.Answer2;
                job.Answer3    = jobTemp.Answer3;
                job.Answer4    = jobTemp.Answer4;
                job.WorkStatus = jobTemp.WorkStatus;

                job.DateTime2 = jobTemp.DateTime2;
                //job.DateTime1 = jobTemp.DateTime1;
                job.DateTime3 = jobTemp.DateTime3;
                job.DateTime4 = jobTemp.DateTime4;

                job.Value1 = jobTemp.Value1;
                job.Value2 = jobTemp.Value2;
                job.Value3 = jobTemp.Value3;
                job.Value4 = jobTemp.Value4;

                job.Notes      = jobTemp.Notes;
                job.Attention1 = jobTemp.Attention1;
                job.Attention2 = jobTemp.Attention2;
                job.Attention3 = jobTemp.Attention3;
                job.Attention4 = jobTemp.Attention4;
                job.Attention5 = jobTemp.Attention5;
                job.Attention6 = jobTemp.Attention6;
                job.Attention7 = jobTemp.Attention7;
            }
            else
            {
                #region
                job.Attention1 = @"<p>You can insure separately at a premium of 1.50% of total value.(Min. Premium is $100.00)
                Please be advised that completed insurance application must be submitted to our office prior to pack and move dates. There is no liability on Collin’s Movers upon the decline of insurance. All items in the shipment must be insured. Any policy that covers only a limited number of items in the shipment may be subject to rejection by insurance company.</p>
                <p>This Quotation is based on us providing a normal weekday(Monday to Saturday)services unless otherwise stated. Any substantial variation in the volume will affect our charges. The validity of this quotation is 30 days from the date of issue.</p>
                ";
                job.Attention2 = @"<p>*Preparation : Delivery of cartons and tapes for self packing.</p>
                <p>*Packing Materials : Provide required quantity of packing materials such as various sizes of cartons boxes, Bubble wraps, Tapes etc. Our service includes one time collection of empty cartons after the completion of the move.</p>
                <p>*Pack and Unpack: Wrapping and packing of all fragile to include china, glassware, paintings, ornaments, books files, kitchenware and miscellaneous item and unpacking on destination if not specified.</p>
                <p>*Moving: Provide skilled and experienced movers to pack and move your house hold items.</p>
                <p>*Supervisor : Provide highly experienced and skilled team supervisor during the entire move.</p>
                <p>*Transportation: Provide Collins Movers 22ft covered truck equipped with hydraulic tail gate system. All trucks are equipped with GPS tracking system to monitor the truck movements.</p>
                <p>*MCST Process: Removal permit application and refundable cheque deposit if applicable for your condominium move.</p>
                ";
                job.Attention3 = @"<p>*Insurance coverage</p>
                <p>*Non refundable Condominium administration fee, Lift padding fee or any such fees.</p>
                <p>*Handyman Services.</p>
                <p>*Maid Services.</p>
                <p>*Piano and Safe handling.</p>
                <p>*Additional pickup and delivery unless specified.</p>
                ";
                job.Attention4 = @"<p>This quotation is based on providing a normal weekday(Monday to Saturday) services unless otherwise</p><p> stated. To confirm acceptance of our services please complete the attached Acceptance Sheet and return to</p><p> us bay fax ,mail or email as soon as possible.</p>
                
                ";
                job.Attention5 = @"<p>FULL Payment is required on the FIRST day of the move. We require company’s stamp and authorized</p><p> signature on the acceptance sheet in case payment is made by Company. Please make cheque payable to</p><p> Collins Movers Pte Ltd. For cash payment, Please contact our office beforehand and speak to sales person</p><p> on this agreement.</p>
                <p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
                <p>Once a booking has been made any cancellation of job would result in a penalty of 30% upon the contract</p><p> agreed. However within 24 hours prior to the commencement of the move, any cancellation would be</p><p> penalized at 70% of the contract agreed.</p>
                <p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
                <p>We thank you once again for the opportunity to be of service to you. We hope that the above rate meets</p><p> your approval and should you require any further information regarding our services, please do not hesitate</p><p> to contact us.</p>
                ";

                #endregion
            }


            string userId = HttpContext.Current.User.Identity.Name;

            job.CreateBy       = userId;
            job.CreateDateTime = DateTime.Now;
            job.UpdateBy       = userId;
            job.UpdateDateTime = DateTime.Now;
            job.QuotationNo    = issueN;
            job.DateTime1      = DateTime.Now;
            job.DateTime2      = DateTime.Now;
            job.Value2         = userId;
            Manager.ORManager.StartTracking(job, Wilson.ORMapper.InitialState.Inserted);
            Manager.ORManager.PersistChanges(job);
            C2Setup.SetNextNo("", "Quotation", issueN, issueDate.Date);

            return(job.QuotationNo);
        }
        catch { }
        return("");
    }