Ejemplo n.º 1
0
 void Start()
 {
     panel = new VerticalPanel();
     panel.Add(new NumericTextBox(0.0f));
     panel.VisibilityProperty.BindBoth(()=>panelVisible, b=>panelVisible = b);
     panel.Add(new Button("Hippos").SetLayoutOptions(GUILayout.Width(300), GUILayout.Height(100)));
     panel.Add(new Button("Are"));
     var moo = new Toggle("Fun!").SetLayoutOptions(GUILayout.Width(100)).IsCheckedProperty.BindSet(b=>weeee.Visible = b);
     panel.Add(moo);
     weeee = new Button("OMFGWeeeeee!");
     weeee.Clicked += button => { Debug.Log("Moo!"); moo.IsChecked = !moo.IsChecked; };
     panel.Add(weeee);
 }
Ejemplo n.º 2
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());
            try
            {
                string     hMode                  = Dispatch.EitherField("HiddenMode");
                string     id                     = Dispatch.EitherField("badt_BadTypeid");
                int        errorflag              = 0;
                string     errormessage           = string.Empty;
                Record     BadType                = FindRecord("BadType", "badt_BadTypeid=" + id);
                string     badt_maintenanceid     = BadType.GetFieldAsString("badt_maintenanceid");
                EntryGroup DecoratePersonNewEntry = new EntryGroup("BadTypeNewEntry");
                DecoratePersonNewEntry.Fill(BadType);

                AddTabHead("Delete BadType");
                if (hMode == "Delete")
                {
                    BadType.DeleteRecord = true;
                    BadType.SaveChanges();
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mate_MaintenanceId=" + badt_maintenanceid + "&J=Summary";
                    url = url.Replace("Key37", "BadTypeid");
                    url = url + "&Key37=" + badt_maintenanceid;
                    Dispatch.Redirect(url);
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Delete';";
                    DecoratePersonNewEntry.GetHtmlInViewMode(BadType);
                    vpMainPanel.Add(DecoratePersonNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("ConfirmDelete", "Delete.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mate_MaintenanceId=" + badt_maintenanceid + "&J=Summary";
                    url = url.Replace("Key37", "BadTypeid");
                    url = url + "&Key37=" + badt_maintenanceid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 3
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string compid = Dispatch.EitherField("comp_companyid");
                if (string.IsNullOrEmpty(compid))
                {
                    compid = Dispatch.EitherField("key1");
                }
                string     hMode     = Dispatch.EitherField("HiddenMode");
                EntryGroup IntiEntry = new EntryGroup("InvoiceTitleNewEntry");
                IntiEntry.Title = "发票抬头";
                int errflag = 0;
                AddTabHead("InvoiceTitle");
                if (hMode == "Save")
                {
                    Record IntiRec = new Record("InvoiceTitle");
                    IntiEntry.Fill(IntiRec);
                    if (IntiEntry.Validate() == true)
                    {
                        IntiRec.SetField("inti_companyid", compid);
                        IntiRec.SaveChanges();
                        Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunInvoiceTitleList") + "&comp_companyid=" + compid + "&J=InvoiceTitle&T=Company");
                    }
                }
                if (errflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    IntiEntry.GetHtmlInEditMode();
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(IntiEntry);
                    AddContent(vp);

                    string url = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    AddSubmitButton("Save", "Save.gif", url);
                    AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunInvoiceTitleList") + "&comp_companyid=" + compid + "&J=InvoiceTitle&T=Company");
                }
            }
            catch (Exception ex)
            {
                AddError(ex.Message + "IntiAddPage");
            }
        }
Ejemplo n.º 4
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());
            try
            {
                string     hMode                = Dispatch.EitherField("HiddenMode");
                string     id                   = Dispatch.EitherField("cust_cususestatusid");
                int        errorflag            = 0;
                string     errormessage         = string.Empty;
                Record     CusUseStatus         = FindRecord("CusUseStatus", "cust_cususestatusid=" + id);
                string     cust_serviceacceptid = CusUseStatus.GetFieldAsString("cust_serviceacceptid");
                EntryGroup CusUseStatusNewEntry = new EntryGroup("CusUseStatusNewEntry");
                CusUseStatusNewEntry.Fill(CusUseStatus);

                AddTabHead("Delete CusUseStatus");
                if (hMode == "Delete")
                {
                    CusUseStatus.DeleteRecord = true;
                    CusUseStatus.SaveChanges();
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&seac_ServiceAcceptId=" + cust_serviceacceptid + "&J=Summary";
                    url = url.Replace("Key37", "CusUseStatusid");
                    url = url + "&Key37=" + cust_serviceacceptid;
                    Dispatch.Redirect(url);
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Delete';";
                    CusUseStatusNewEntry.GetHtmlInViewMode(CusUseStatus);
                    vpMainPanel.Add(CusUseStatusNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("ConfirmDelete", "Delete.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&seac_ServiceAcceptId=" + cust_serviceacceptid + "&J=Summary";
                    url = url.Replace("Key37", "CusUseStatusid");
                    url = url + "&Key37=" + cust_serviceacceptid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 5
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());
            try
            {
                string     hMode                = Dispatch.EitherField("HiddenMode");
                string     id                   = Dispatch.EitherField("vico_VisitComponyid");
                int        errorflag            = 0;
                string     errormessage         = string.Empty;
                Record     VisitCompony         = FindRecord("VisitCompony", "vico_VisitComponyid=" + id);
                string     vico_monthplanid     = VisitCompony.GetFieldAsString("vico_monthplanid");
                EntryGroup VisitComponyNewEntry = new EntryGroup("VisitComponyNewEntry");
                VisitComponyNewEntry.Fill(VisitCompony);

                AddTabHead("Delete VisitCompony");
                if (hMode == "Delete")
                {
                    VisitCompony.DeleteRecord = true;
                    VisitCompony.SaveChanges();
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + vico_monthplanid + "&J=Summary";
                    url = url.Replace("Key37", "VisitComponyid");
                    url = url + "&Key37=" + vico_monthplanid;
                    Dispatch.Redirect(url);
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Delete';";
                    VisitComponyNewEntry.GetHtmlInViewMode(VisitCompony);
                    vpMainPanel.Add(VisitComponyNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("ConfirmDelete", "Delete.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + vico_monthplanid + "&J=Summary";
                    url = url.Replace("Key37", "VisitComponyid");
                    url = url + "&Key37=" + vico_monthplanid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 6
0
        public override void BuildContents()
        {
            try {
                string opco_OppoCompetitorId = Dispatch.EitherField("opco_OppoCompetitorId");
                if (string.IsNullOrEmpty(opco_OppoCompetitorId))
                {
                    opco_OppoCompetitorId = Dispatch.EitherField("key58");
                }

                Record OppoCompetitor = FindRecord("OppoCompetitor", "opco_OppoCompetitorId=" + opco_OppoCompetitorId);

                EntryGroup screenOppoCompetitor = new EntryGroup("OppoCompetitorNewEntry");
                screenOppoCompetitor.Title = "OppoCompetitor";
                screenOppoCompetitor.Fill(OppoCompetitor);

                string status = OppoCompetitor.GetFieldAsString("opco_status");

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(screenOppoCompetitor);

                AddContent(vpMainPanel);
                AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&opco_OppoCompetitorId=" + opco_OppoCompetitorId);
                AddUrlButton("Delete", "Delete.gif", UrlDotNet(ThisDotNetDll, "RunDataPageDelete") + "&opco_OppoCompetitorId=" + opco_OppoCompetitorId);
                string opportunityid = Dispatch.EitherField("Key7");
                string competitorid  = Dispatch.EitherField("key58");
                if (!string.IsNullOrEmpty(opportunityid))
                {
                    AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoCompetitor&T=Opportunity");
                }
                else if (!string.IsNullOrEmpty(competitorid))
                {
                    AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunCompetitorListPage") + "&J=OppoCompetitor&T=Competitor");
                }
                else
                {
                    AddUrlButton("Continue", "Continue.gif", UrlDotNet("SalesMenu", "RunOppoCompetitor") + "&J=OppoCompetitor&T=SalesManagement");
                }
            } catch (Exception error) {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 7
0
        public override void BuildContents()
        {
            try
            {
                string mact_MarketActivityid = Dispatch.EitherField("mact_MarketActivityid");

                Record MarketActivity = FindRecord("MarketActivity", "mact_MarketActivityid=" + mact_MarketActivityid);
                cpet_competitorid = MarketActivity.GetFieldAsString("mact_competitorid");

                Record order  = FindRecord("Competitor", "cpet_competitorid=" + cpet_competitorid);
                int    userid = CurrentUser.UserId;
                if (userid == 137 || userid == 43 || userid == 130 || CurrentUser.IsAdmin())
                {
                    string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunMarketActivityEdit") + "&mact_MarketActivityid=" + mact_MarketActivityid;
                    Dispatch.Redirect(urledit);
                }

                EntryGroup MarketActivityNewEntry = new EntryGroup("MarketActivityNewEntry");

                MarketActivityNewEntry.Title = "MarketActivity";
                MarketActivityNewEntry.Fill(MarketActivity);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(MarketActivityNewEntry);
                AddContent(vpMainPanel);
                if (userid == 137 || userid == 43 || userid == 130 || CurrentUser.IsAdmin())
                {
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunMarketActivityDelete") + "&mact_MarketActivityid=" + mact_MarketActivityid;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                }

                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cpet_competitorid=" + cpet_competitorid;
                url = url.Replace("Key37", "MarketActivityid");
                url = url + "&Key37=" + cpet_competitorid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 8
0
        public override void BuildContents()
        {
            try
            {
                string code_ContractDetailId = Dispatch.EitherField("code_ContractDetailId");

                Record ContractDetail = FindRecord("ContractDetail", "code_ContractDetailId=" + code_ContractDetailId);
                cont_ContractId = ContractDetail.GetFieldAsString("code_contractid");

                Record order  = FindRecord("Contract", "cont_ContractId=" + cont_ContractId);
                string status = order.GetFieldAsString("cont_status");
                if (status == "draft")
                {
                    string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunContractDetailEdit") + "&code_ContractDetailId=" + code_ContractDetailId;
                    Dispatch.Redirect(urledit);
                }


                EntryGroup ContractDetailNewEntry = new EntryGroup("ContractDetailNewEntry");

                ContractDetailNewEntry.Title = "ContractDetail";
                ContractDetailNewEntry.Fill(ContractDetail);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(ContractDetailNewEntry);
                AddContent(vpMainPanel);
                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunContractDetailDelete") + "&code_ContractDetailId=" + code_ContractDetailId;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);

                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cont_ContractId=" + cont_ContractId;
                url = url.Replace("Key37", "ContractDetailid");
                url = url + "&Key37=" + cont_ContractId;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
                AddWorkflowButtons("ContractDetail");
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 9
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string     compid  = Dispatch.EitherField("comp_companyid");
                string     hMode   = Dispatch.EitherField("HiddenMode");
                EntryGroup USEntry = new EntryGroup("UseSituationNewEntry");
                USEntry.Title = "使用情况";
                int errflag = 0;
                AddTabHead("UseSituation");
                if (hMode == "Save")
                {
                    Record USRec = new Record("UseSituation");
                    USEntry.Fill(USRec);
                    if (USEntry.Validate() == true)
                    {
                        USRec.SetField("usst_companyid", compid);
                        USRec.SaveChanges();
                        Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunUSList") + "&comp_companyid=" + compid + "&J=Summary&T=CompanySummary");
                    }
                }
                if (errflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    USEntry.GetHtmlInEditMode();
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(USEntry);
                    AddContent(vp);

                    string url = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    AddSubmitButton("Save", "Save.gif", url);
                    AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunUSList") + "&comp_companyid=" + compid + "&J=Summary&T=CompanySummary");
                }
            }
            catch (Exception ex)
            {
                AddError(ex.Message + "USAddPage");
            }
        }
Ejemplo n.º 10
0
        public override void BuildContents()
        {
            try
            {
                string cust_cususestatusid = Dispatch.EitherField("cust_cususestatusid");

                Record CusUseStatus         = FindRecord("CusUseStatus", "cust_cususestatusid=" + cust_cususestatusid);
                string cust_serviceacceptid = CusUseStatus.GetFieldAsString("cust_serviceacceptid");


                int userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunCusUseStatusEdit") + "&cust_cususestatusid=" + cust_cususestatusid;
                Dispatch.Redirect(urledit);


                EntryGroup CusUseStatusNewEntry = new EntryGroup("CusUseStatusNewEntry");

                CusUseStatusNewEntry.Title = "CusUseStatus";
                CusUseStatusNewEntry.Fill(CusUseStatus);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(CusUseStatusNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunCusUseStatusDelete") + "&cust_cususestatusid=" + cust_cususestatusid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&seac_ServiceAcceptId=" + cust_serviceacceptid;
                url = url.Replace("Key37", "CusUseStatusid");
                url = url + "&Key37=" + cust_serviceacceptid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 11
0
        public override void BuildContents()
        {
            try
            {
                string acco_ActualCostid = Dispatch.EitherField("acco_ActualCostid");

                Record ActualCost        = FindRecord("ActualCost", "acco_ActualCostid=" + acco_ActualCostid);
                string acco_maractplanid = ActualCost.GetFieldAsString("acco_maractplanid");


                int userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunActualCostEdit") + "&acco_ActualCostid=" + acco_ActualCostid;
                Dispatch.Redirect(urledit);


                EntryGroup DecoratePersonNewEntry = new EntryGroup("ActualCostNewEntry");

                DecoratePersonNewEntry.Title = "ActualCost";
                DecoratePersonNewEntry.Fill(ActualCost);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(DecoratePersonNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunActualCostDelete") + "&acco_ActualCostid=" + acco_ActualCostid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mapl_MarActPlanId=" + acco_maractplanid;
                url = url.Replace("Key37", "Personid");
                url = url + "&Key37=" + acco_maractplanid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 12
0
        public override void BuildContents()
        {
            try
            {
                string badt_BadTypeid = Dispatch.EitherField("badt_BadTypeid");

                Record BadType            = FindRecord("BadType", "badt_BadTypeid=" + badt_BadTypeid);
                string badt_maintenanceid = BadType.GetFieldAsString("badt_maintenanceid");


                int userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunBadTypeEdit") + "&badt_BadTypeid=" + badt_BadTypeid;
                Dispatch.Redirect(urledit);


                EntryGroup DecoratePersonNewEntry = new EntryGroup("BadTypeNewEntry");

                DecoratePersonNewEntry.Title = "BadType";
                DecoratePersonNewEntry.Fill(BadType);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(DecoratePersonNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunBadTypeDelete") + "&badt_BadTypeid=" + badt_BadTypeid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mate_MaintenanceId=" + badt_maintenanceid;
                url = url.Replace("Key37", "BadTypeid");
                url = url + "&Key37=" + badt_maintenanceid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 13
0
        public override void BuildContents()
        {
            try
            {
                string vico_VisitComponyid = Dispatch.EitherField("vico_VisitComponyid");

                Record VisitCompony     = FindRecord("VisitCompony", "vico_VisitComponyid=" + vico_VisitComponyid);
                string vico_monthplanid = VisitCompony.GetFieldAsString("vico_monthplanid");


                int userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunVisitComponyEdit") + "&vico_VisitComponyid=" + vico_VisitComponyid;
                Dispatch.Redirect(urledit);


                EntryGroup VisitComponyNewEntry = new EntryGroup("VisitComponyNewEntry");

                VisitComponyNewEntry.Title = "VisitCompony";
                VisitComponyNewEntry.Fill(VisitCompony);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(VisitComponyNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunVisitComponyDelete") + "&vico_VisitComponyid=" + vico_VisitComponyid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + vico_monthplanid;
                url = url.Replace("Key37", "VisitComponyid");
                url = url + "&Key37=" + vico_monthplanid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 14
0
        public override void BuildContents()
        {
            try
            {
                string spde_SalePlanDetailid = Dispatch.EitherField("spde_SalePlanDetailid");

                Record SalePlanDetail   = FindRecord("SalePlanDetail", "spde_SalePlanDetailid=" + spde_SalePlanDetailid);
                string spde_monthplanid = SalePlanDetail.GetFieldAsString("spde_monthplanid");


                int userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunSalePlanDetailEdit") + "&spde_SalePlanDetailid=" + spde_SalePlanDetailid;
                Dispatch.Redirect(urledit);


                EntryGroup DecoratePersonNewEntry = new EntryGroup("SalePlanDetailNewEntry");

                DecoratePersonNewEntry.Title = "SalePlanDetail";
                DecoratePersonNewEntry.Fill(SalePlanDetail);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(DecoratePersonNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunSalePlanDetailDelete") + "&spde_SalePlanDetailid=" + spde_SalePlanDetailid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + spde_monthplanid;
                url = url.Replace("Key37", "SalePlanDetailid");
                url = url + "&Key37=" + spde_monthplanid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 15
0
        public override void BuildContents()
        {
            try
            {
                string brra_BrandRateId = Dispatch.EitherField("brra_BrandRateId");

                Record BrandRate = FindRecord("BrandRate", "brra_BrandRateId=" + brra_BrandRateId);
                maif_MarketInfoId = BrandRate.GetFieldAsString("brra_marketinfoid");

                Record order  = FindRecord("MarketInfo", "maif_MarketInfoId=" + maif_MarketInfoId);
                string status = order.GetFieldAsString("maif_status");
                // if (status == "draft")
                //{
                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunBrandRateEdit") + "&brra_BrandRateId=" + brra_BrandRateId;
                Dispatch.Redirect(urledit);
                //}

                EntryGroup BrandRateNewEntry = new EntryGroup("BrandRateNewEntry");

                BrandRateNewEntry.Title = "BrandRate";
                BrandRateNewEntry.Fill(BrandRate);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(BrandRateNewEntry);
                AddContent(vpMainPanel);
                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunBrandRateDelete") + "&brra_BrandRateId=" + brra_BrandRateId;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);

                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&maif_MarketInfoId=" + maif_MarketInfoId;
                url = url.Replace("Key37", "BrandRateid");
                url = url + "&Key37=" + maif_MarketInfoId;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
                AddWorkflowButtons("BrandRate");
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 16
0
        public override void BuildContents()
        {
            try {
                string optr_OppoTrackId = Dispatch.EitherField("optr_OppoTrackId");
                if (string.IsNullOrEmpty(optr_OppoTrackId))
                {
                    optr_OppoTrackId = Dispatch.EitherField("key58");
                }

                Record OppoTrack = FindRecord("OppoTrack", "optr_OppoTrackId=" + optr_OppoTrackId);

                EntryGroup screenOppoTrack = new EntryGroup("OppoTrackNewEntry");
                screenOppoTrack.Title = "OppoTrack";
                screenOppoTrack.Fill(OppoTrack);

                string status = OppoTrack.GetFieldAsString("optr_status");

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(screenOppoTrack);

                AddContent(vpMainPanel);
                AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&optr_OppoTrackId=" + optr_OppoTrackId);
                AddUrlButton("Delete", "Delete.gif", UrlDotNet(ThisDotNetDll, "RunDataPageDelete") + "&optr_OppoTrackId=" + optr_OppoTrackId);
                string url = string.Empty;
                string optr_opportunityid = Dispatch.EitherField("key7");
                if (string.IsNullOrEmpty(optr_opportunityid))
                {
                    url = UrlDotNet("SalesMenu", "RunOppoTrack") + "&J=OppoTrack&T=SalesManagement";
                }
                else
                {
                    url = UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoTrack&T=Opportunity";
                }
                AddUrlButton("Cancel", "cancel.gif", url);
            }
            catch (Exception error) {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 17
0
        public override void BuildContents()
        {
            try
            {
                string dper_decoratepersonid = Dispatch.EitherField("dper_decoratepersonid");

                Record DecoratePerson = FindRecord("DecoratePerson", "dper_decoratepersonid=" + dper_decoratepersonid);
                cpet_competitorid = DecoratePerson.GetFieldAsString("dper_competitorid");

                Record order  = FindRecord("Competitor", "cpet_competitorid=" + cpet_competitorid);
                int    userid = CurrentUser.UserId;

                string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunPersonEdit") + "&dper_decoratepersonid=" + dper_decoratepersonid;
                Dispatch.Redirect(urledit);


                EntryGroup CompetitionPersonNewEntry = new EntryGroup("CompetitionPersonNewEntry");

                CompetitionPersonNewEntry.Title = "DecoratePerson";
                CompetitionPersonNewEntry.Fill(DecoratePerson);

                VerticalPanel vpMainPanel = new VerticalPanel();
                vpMainPanel.AddAttribute("width", "100%");
                vpMainPanel.Add(CompetitionPersonNewEntry);
                AddContent(vpMainPanel);

                string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunPersonDelete") + "&dper_decoratepersonid=" + dper_decoratepersonid;
                base.AddUrlButton("Delete", "Delete.gif", urldelete);


                string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cpet_competitorid=" + cpet_competitorid;
                url = url.Replace("Key37", "Personid");
                url = url + "&Key37=" + cpet_competitorid;
                this.AddUrlButton("cancel", "PrevCircle.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 18
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string     qdid    = Dispatch.EitherField("qtdt_QuotationDetailID");
                EntryGroup QDEntry = new EntryGroup("QuotationDetailNewEntry");
                QDEntry.Title = "报价明细";
                Record QDRec  = FindRecord("QuotationDetail", "qtdt_QuotationDetailID=" + qdid);
                string qutaid = Dispatch.EitherField("quta_Quotationid");
                if (string.IsNullOrEmpty(qutaid))
                {
                    qutaid = QDRec.GetFieldAsString("qtdt_qutaID");
                }
                Record QutaRec  = FindRecord("Quotation", "quta_Quotationid=" + qutaid);
                string exchange = QutaRec.GetFieldAsString("quta_exchange");
                if (string.IsNullOrEmpty(exchange) || exchange == "0")
                {
                    exchange = "1";
                }
                AddContent(HTML.InputHidden("exchange", exchange));
                string currency = QutaRec.GetFieldAsString("quta_currencysid");
                if (!string.IsNullOrEmpty(currency))
                {
                    Record currRec  = FindRecord("Currencys", "curr_CurrencysId=" + currency);
                    string currname = currRec.GetFieldAsString("curr_des");
                    AddContent(HTML.InputHidden("currency", currname));
                }


                string hMode = Dispatch.EitherField("HiddenMode");

                int errflag = 0;
                AddTabHead("QuotationDetail");
                //GetTabs("QuotationDetail", "QuotationDetail Summary");
                if (hMode == "Save")
                {
                    QDEntry.Fill(QDRec);
                    if (QDEntry.Validate() == true)
                    {
                        QDRec.SetField("quta_Quotationid", qutaid);

                        QDRec.SaveChanges();
                        QuerySelect qs             = this.GetQuery();
                        string      qtdtid         = QDRec.RecordId.ToString();
                        double      thislocalaount = Convert.ToDouble(Dispatch.ContentField("qtdt_localeamount"));
                        qs.SQLCommand = "exec crm_UpdateOpportunityQutaPrice @quotationid=" + qutaid;
                        qs.ExecuteNonQuery();
//                        string productinfoid = Dispatch.ContentField("qtdt_productinfoid");
//                        double thislocalaount = Convert.ToDouble(Dispatch.ContentField("qtdt_localeamount"));
//                        double thisforeignamount = Convert.ToDouble(Dispatch.ContentField("qtdt_foreignamount"));
//                        string select = @"select qtdt_localeamount,qtdt_foreignamount,quta_opportunityid from  QuotationDetail where qtdt_UpdatedDate =
//                        (select MAX( qtdt_UpdatedDate) from QuotationDetail
//                        left join Quotation on quta_QuotationID = qtdt_qutaid
//                        left join Opportunity on Oppo_OpportunityId = quta_opportunityid
//                        where qtdt_productinfoid = " + productinfoid + @" and quta_opportunityid = 12 and Oppo_Deleted is null and quta_Deleted is null and qtdt_Deleted is null) ";
//                        qs.SQLCommand = select;
//                        qs.ExecuteReader();
//                        double qtdt_localeamount = 0, qtdt_foreignamount = 0;
//                        string quta_opportunityid = string.Empty;
//                        if (!qs.Eof())
//                        {
//                            qtdt_localeamount = Convert.ToDouble(qs.FieldValue("qtdt_localeamount"));
//                            qtdt_foreignamount = Convert.ToDouble(qs.FieldValue("qtdt_foreignamount"));
//                            quta_opportunityid = qs.FieldValue("quta_opportunityid");
//                        }
//                        double resultlocal = thislocalaount - qtdt_localeamount;
//                        double resultforeign = thisforeignamount = qtdt_foreignamount;
//                        string updatesql = @"update Opportunity set oppo_qutaprice = ISNULL(oppo_qutaprice,0) + " + resultlocal + " where Oppo_OpportunityId =" + quta_opportunityid;
//                        qs.SQLCommand = updatesql;
//                        qs.ExecuteNonQuery();


                        //QuerySelect qs = this.GetQuery();
                        qs.SQLCommand = @"Update Quotation set quta_localeamount = (select sum(qtdt_localeamount) from QuotationDetail where qtdt_deleted is null and qtdt_qutaid= " + qutaid + @")
                        ,quta_foreignamount =  (select sum(qtdt_foreignamount) from QuotationDetail where qtdt_deleted is null and qtdt_qutaid= " + qutaid + @")    where quta_Quotationid=" + qutaid;
                        qs.ExecuteNonQuery();
                        Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + qutaid);
                    }
                }
                if (errflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    QDEntry.GetHtmlInEditMode(QDRec);
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(QDEntry);
                    AddContent(vp);

                    string url = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    AddSubmitButton("Save", "Save.gif", url);
                    AddUrlButton("Delete", "Delete.gif", UrlDotNet(ThisDotNetDll, "RunQDDelete") + "&quta_Quotationid=" + qutaid + "&qtdt_QuotationDetailID=" + qdid);

                    AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + qutaid);
                }
            }
            catch (Exception ex)
            {
                AddError(ex.Message + "USAddPage");
            }
        }
Ejemplo n.º 19
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try {
                string hMode = Dispatch.EitherField("HiddenMode");
                string opco_opportunityid = Dispatch.EitherField("Key7");
                string opportunityid      = Dispatch.EitherField("Key7");
                //string opco_OppoCompetitorId = Dispatch.EitherField("opco_OppoCompetitorId");
                int        errorflag              = 0;
                string     errormessage           = string.Empty;
                EntryGroup OppoCompetitorNewEntry = new EntryGroup("OppoCompetitorNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry opco_opportunityidEntry = OppoCompetitorNewEntry.GetEntry("opco_opportunityid");
                if (opco_opportunityidEntry != null)
                {
                    opco_opportunityidEntry.DefaultValue = opco_opportunityid;
                    //opco_opportunityidEntry.ReadOnly = true;
                }
                //Entry opco_competitoridEntry = OppoCompetitorNewEntry.GetEntry("opco_competitorid");
                //if (opco_competitoridEntry != null) {
                //    opco_competitoridEntry.DefaultValue = opco_OppoCompetitorId;
                //    //opco_opportunityidEntry.ReadOnly = true;
                //}

                AddTabHead("OppoCompetitor");
                if (hMode == "Save")
                {
                    Record OppoCompetitor = new Record("OppoCompetitor");
                    OppoCompetitorNewEntry.Fill(OppoCompetitor);
                    if (OppoCompetitorNewEntry.Validate())
                    {
                        OppoCompetitor.SaveChanges();
                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&opco_OppoCompetitorid=" + OppoCompetitor.GetFieldAsString("opco_OppoCompetitorid") + "&J=Summary";
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    if (errorflag == 2)
                    {
                        AddError(errormessage);
                    }

                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    OppoCompetitorNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(OppoCompetitorNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);

                    string url = string.Empty;

                    if (!string.IsNullOrEmpty(opportunityid))
                    {
                        AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoCompetitor&T=Opportunity");
                    }
                    else
                    {
                        AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunCompetitorListPage") + "&J=OppoCompetitor&T=Opportunity");
                    }
                }
            } catch (Exception e) {
                AddError(e.Message);
            }
        }
Ejemplo n.º 20
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string compid = Dispatch.EitherField("comp_companyid");
                if (string.IsNullOrEmpty(compid))
                {
                    compid = Dispatch.EitherField("key1");
                }
                EntryGroup CompEntry = new EntryGroup("CompanyBoxLong");
                CompEntry.Title = "基础信息";
                EntryGroup DealEntry = new EntryGroup("CompanyDealEntry");
                DealEntry.Title = "交易信息";
                EntryGroup StatusEntry = new EntryGroup("CompanyStatusEntry");
                StatusEntry.Title = "状态信息";
                Record CompRec = FindRecord("Company", "comp_companyid=" + compid);
                CompEntry.Fill(CompRec);
                DealEntry.Fill(CompRec);
                StatusEntry.Fill(CompRec);
                GetTabs("CompanySummary", "Summary");

                //Entry userid = CompEntry.GetEntry("comp");
                //userid.OnChangeScript = "";
                List UseList = new List("UseSituationGrid");
                UseList.Filter    = "usst_deleted is null and usst_companyid =" + compid;
                UseList.PadBottom = false;
                List AddressList = new List("CompanyAddressGrid");
                AddressList.Filter    = "addr_deleted is null and addr_companyid =" + compid;
                AddressList.PadBottom = false;
                List InvoceList = new List("InvoiceTitleGrid");
                InvoceList.Filter    = "inti_deleted is null and inti_companyid=" + compid;
                InvoceList.PadBottom = false;
                //FollowGrid
                //List FollowList = new List("FollowGrid");
                //FollowList.Filter = "foll_deleted is null and foll_companyid=" + compid;
                //FollowList.PadBottom = false;

                CompEntry.GetHtmlInViewMode(CompRec);
                DealEntry.GetHtmlInViewMode(CompRec);
                StatusEntry.GetHtmlInViewMode(CompRec);
                VerticalPanel vp = new VerticalPanel();
                vp.AddAttribute("width", "100%");
                vp.Add(CompEntry);
                vp.Add(DealEntry);
                vp.Add(StatusEntry);
                vp.Add(UseList);
                vp.Add(AddressList);
                vp.Add(InvoceList);
                //vp.Add(FollowList);
                AddContent(vp);

                AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&comp_companyid=" + compid);
                AddUrlButton("添加销售情况", "New.gif", UrlDotNet(ThisDotNetDll, "RunUSAdd") + "&comp_companyid=" + compid + "&J=UseSituation Summary");
                AddUrlButton("添加地址", "New.gif", UrlDotNet(ThisDotNetDll, "RunAddressAdd") + "&comp_companyid=" + compid + "&J=Address");
                AddUrlButton("添加抬头", "New.gif", UrlDotNet(ThisDotNetDll, "RunInvoiceAdd") + "&comp_companyid=" + compid + "&J=InvoiceTitle");
                AddUrlButton("添加跟进", "New.gif", UrlDotNet("Follow", "RunDataPageNew") + "&key1=" + compid + "&J=follow");

                AddUrlButton("Cancel", "Cancel.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&T=CompanyList");
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 21
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode = Dispatch.EitherField("HiddenMode");
                string     pmet_ProcessMethodid  = Dispatch.EitherField("pmet_ProcessMethodid");
                int        errorflag             = 0;
                string     errormessage          = string.Empty;
                Record     ProcessMethod         = FindRecord("ProcessMethod", "pmet_ProcessMethodid=" + pmet_ProcessMethodid);
                string     pmet_monthplanid      = ProcessMethod.GetFieldAsString("pmet_monthplanid");
                EntryGroup ProcessMethodNewEntry = new EntryGroup("ProcessMethodNewEntry");
                ProcessMethodNewEntry.Fill(ProcessMethod);
                Entry IntentionOrderidEntry = ProcessMethodNewEntry.GetEntry("pmet_monthplanid");

                IntentionOrderidEntry.ReadOnly = true;

                //AddTabHead("Person");
                //GetTabs("Person", "Person Summary");
                AddTabHead("ProcessMethod");
                if (hMode == "Save")
                {
                    ////double original =Person.GetFieldAsDouble("");
                    ProcessMethodNewEntry.Fill(ProcessMethod);
                    ////double  =Person.GetFieldAsDouble("");

                    if (ProcessMethodNewEntry.Validate())
                    {
                        ProcessMethod.SaveChanges();

                        ////Record BusReport= FindRecord("BusReport", "cpet_competitorid=" + cpet_competitorid);
                        ////double  = BusReport.GetFieldAsDouble("");
                        //// =  + - original;
                        ////BusReport.SetField("", );
                        ////BusReport.SaveChanges();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + pmet_monthplanid + "&J=Summary";
                        url = url.Replace("Key37", "Personid");
                        url = url + "&Key37=" + pmet_monthplanid;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    ProcessMethodNewEntry.GetHtmlInEditMode(ProcessMethod);
                    vpMainPanel.Add(ProcessMethodNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunProcessMethodDelete") + "&pmet_ProcessMethodid=" + pmet_ProcessMethodid;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + pmet_monthplanid + "&J=Summary";
                    url = url.Replace("Key37", "ProcessMethodid");
                    url = url + "&Key37=" + pmet_monthplanid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 22
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode               = Dispatch.EitherField("HiddenMode");
                string     cpet_competitorid   = Dispatch.EitherField("cpet_competitorid");
                int        errorflag           = 0;
                string     errormessage        = string.Empty;
                EntryGroup CpetProductNewEntry = new EntryGroup("CpetProductNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry bred_busreportidEntry = CpetProductNewEntry.GetEntry("cppr_competitorid");
                if (bred_busreportidEntry != null)
                {
                    bred_busreportidEntry.DefaultValue = cpet_competitorid;
                    bred_busreportidEntry.ReadOnly     = true;
                }

                AddTabHead("CpetProduct");
                if (hMode == "Save")
                {
                    Record CpetProduct = new Record("CpetProduct");
                    CpetProductNewEntry.Fill(CpetProduct);
                    if (CpetProductNewEntry.Validate())
                    {
                        //QuerySelect s = new QuerySelect();
                        //string prefix = "bred" + DateTime.Now.ToString("yyyyMMdd");
                        //s.SQLCommand = "select count(*) as count from CpetProduct where bred_name like '" + prefix + "%'";
                        //s.ExecuteReader();
                        //int cnt = 0;
                        //if (!s.Eof())
                        //{
                        //    cnt = Convert.ToInt32(s.FieldValue("count"));
                        //}
                        //string code = string.Empty;
                        //code = prefix + (cnt + 1).ToString().PadLeft(4, '0');
                        //CpetProduct.SetField("bred_name", code);
                        CpetProduct.SaveChanges();
                        ////Record BusReport= FindRecord("BusReport", "cpet_competitorid=" + cpet_competitorid);
                        ////double  = BusReport.GetFieldAsDouble("");
                        ////double  =CpetProduct.GetFieldAsDouble("");
                        //// =  + ;
                        ////BusReport.SetField("", );
                        ////BusReport.SaveChanges();
                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cpet_competitorid=" + cpet_competitorid + "&J=Summary";
                        url = url.Replace("Key37", "CpetProductid");
                        url = url + "&Key37=" + cpet_competitorid;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    if (errorflag == 2)
                    {
                        AddError(errormessage);
                    }

                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    CpetProductNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(CpetProductNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cpet_competitorid=" + cpet_competitorid + "&J=Summary";
                    url = url.Replace("Key37", "CpetProductid");
                    url = url + "&Key37=" + cpet_competitorid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 23
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string qutaid = Dispatch.EitherField("quta_Quotationid");
                if (string.IsNullOrEmpty(qutaid))
                {
                    qutaid = Dispatch.EitherField("key58");
                }

                EntryGroup qutacompEntry = new EntryGroup("QuotationCompanyEntry");
                qutacompEntry.Title = "商机客户";
                EntryGroup qutaEntry = new EntryGroup("QuotationNewEntry");
                qutaEntry.Title = "报价信息";
                Record qutaRec = FindRecord("Quotation", "quta_Quotationid=" + qutaid);
                qutacompEntry.Fill(qutaRec);
                qutaEntry.Fill(qutaRec);
                GetTabs("Quotation", "Quotation Summary");
                string hMode = Dispatch.EitherField("HiddenMode");
                string quta_opportunityid = qutaRec.GetFieldAsString("quta_opportunityid");
                if (hMode == "Delete")
                {
                    qutaRec.DeleteRecord = true;
                    qutaRec.SaveChanges();

                    QuerySelect qs = this.GetQuery();
                    if (!string.IsNullOrEmpty(quta_opportunityid))
                    {
                        qs.SQLCommand = "Update Opportunity set oppo_qutaprice= (select sum(quta_localeamount) from Quotation where quta_deleted is null and quta_updateoppo = 'Y' and quta_opportunityid = " + quta_opportunityid + " ) where oppo_Opportunityid =" + quta_opportunityid;
                        qs.ExecuteNonQuery();
                    }
                    qs.SQLCommand = "Update QuotationDetail set qtdt_deleted = '1' where qtdt_qutaid =" + qutaid;
                    qs.ExecuteNonQuery();
                    Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=Quotation&T=Opportunity");
                }



                AddContent(HTML.InputHidden("HiddenMode", ""));
                qutacompEntry.GetHtmlInViewMode(qutaRec);
                qutaEntry.GetHtmlInViewMode(qutaRec);
                VerticalPanel vp = new VerticalPanel();
                vp.AddAttribute("width", "100%");
                vp.Add(qutacompEntry);
                vp.Add(qutaEntry);


                AddContent(vp);

                string url = string.Empty;

                url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + qutaid + "&J=OppoTrack&T=Opportunity";
                AddSubmitButton("ConfirmDelete", "Delete.gif", "javascript:document.EntryForm.HiddenMode.value='Delete';");
                AddUrlButton("Cancel", "Cancel.gif", url);
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 24
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try {
                string     hMode              = Dispatch.EitherField("HiddenMode");
                string     optr_OppoTrackId   = Dispatch.EitherField("optr_OppoTrackId");
                int        errorflag          = 0;
                string     errormessage       = string.Empty;
                Record     OppoTrack          = FindRecord("OppoTrack", "optr_OppoTrackId=" + optr_OppoTrackId);
                string     optr_opportunityid = OppoTrack.GetFieldAsString("optr_opportunityid");
                EntryGroup OppoTrackNewEntry  = new EntryGroup("OppoTrackNewEntry");
                OppoTrackNewEntry.Fill(OppoTrack);
                Entry optr_opportunityidEntry = OppoTrackNewEntry.GetEntry("optr_opportunityid");

                optr_opportunityidEntry.ReadOnly = true;

                //AddTabHead("CpetProduct");
                GetTabs("OppoTrack", "Summary");
                if (hMode == "Save")
                {
                    ////double original =CpetProduct.GetFieldAsDouble("");
                    OppoTrackNewEntry.Fill(OppoTrack);
                    ////double  =CpetProduct.GetFieldAsDouble("");

                    if (OppoTrackNewEntry.Validate())
                    {
                        OppoTrack.SaveChanges();

                        QuerySelect qs = this.GetQuery();
                        qs.SQLCommand = @"Update Opportunity set oppo_nexttrackdate = (select MAX(optr_nexttrackdate) from OppoTrack where optr_deleted is null and optr_opportunityid=" + optr_opportunityid + @")
                        ,oppo_trackdate = (select MAX(optr_date) from OppoTrack where optr_deleted is null and optr_opportunityid=" + optr_opportunityid + @" )
                        ,oppo_targetclose = (select optr_targetclose  from OppoTrack where optr_OppoTrackId = " + OppoTrack.RecordId.ToString() + @" )
                        ,oppo_forecast = (select optr_forecast from OppoTrack where optr_OppoTrackId = " + OppoTrack.RecordId.ToString() + @") 
                        ,oppo_certainty = (select optr_certainty  from OppoTrack where optr_OppoTrackId = " + OppoTrack.RecordId.ToString() + @") where oppo_opportunityid=" + optr_opportunityid;
                        qs.ExecuteNonQuery();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&optr_OppoTrackId=" + optr_OppoTrackId + "&J=Summary";
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    OppoTrackNewEntry.GetHtmlInEditMode(OppoTrack);
                    vpMainPanel.Add(OppoTrackNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunDataPageDelete") + "&optr_OppoTrackId=" + optr_OppoTrackId;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&optr_OppoTrackId=" + optr_OppoTrackId + "&J=Summary";
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            } catch (Exception e) {
                AddError(e.Message);
            }
        }
Ejemplo n.º 25
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try {
                string hMode             = Dispatch.EitherField("HiddenMode");
                string mapl_MarActPlanId = Dispatch.EitherField("mapl_MarActPlanId");
                int    errorflag         = 0;
                string errormessage      = string.Empty;
                Record MarActPlan        = FindRecord("MarActPlan", "mapl_MarActPlanId=" + mapl_MarActPlanId);
                //string mapl_opportunityid = MarActPlan.GetFieldAsString("mapl_opportunityid");
                EntryGroup MarActPlanNewEntry = new EntryGroup("MarActPlanNewEntry");
                MarActPlanNewEntry.Fill(MarActPlan);
                //Entry mapl_opportunityidEntry = MarActPlanNewEntry.GetEntry("mapl_opportunityid");

                //mapl_opportunityidEntry.ReadOnly = true;

                //AddTabHead("CpetProduct");
                GetTabs("MarActPlan", "Summary");
                if (hMode == "Save")
                {
                    ////double original =CpetProduct.GetFieldAsDouble("");
                    MarActPlanNewEntry.Fill(MarActPlan);
                    ////double  =CpetProduct.GetFieldAsDouble("");

                    if (MarActPlanNewEntry.Validate())
                    {
                        MarActPlan.SaveChanges();

                        ////Record BusReport= FindRecord("BusReport", "cpet_competitorid=" + cpet_competitorid);
                        ////double  = BusReport.GetFieldAsDouble("");
                        //// =  + - original;
                        ////BusReport.SetField("", );
                        ////BusReport.SaveChanges();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage");
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    MarActPlanNewEntry.GetHtmlInEditMode(MarActPlan);
                    vpMainPanel.Add(MarActPlanNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunDataPageDelete") + "&mapl_MarActPlanId=" + mapl_MarActPlanId;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mapl_MarActPlanId=" + mapl_MarActPlanId + "&J=Summary";
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            } catch (Exception e) {
                AddError(e.Message);
            }
        }
Ejemplo n.º 26
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());

                string qutaid   = Dispatch.EitherField("quta_Quotationid");
                Record QutaRec  = FindRecord("Quotation", "quta_Quotationid=" + qutaid);
                string exchange = QutaRec.GetFieldAsString("quta_exchange");
                if (string.IsNullOrEmpty(exchange) || exchange == "0")
                {
                    exchange = "1";
                }
                string currency = QutaRec.GetFieldAsString("quta_currencysid");
                if (!string.IsNullOrEmpty(currency))
                {
                    Record currRec  = FindRecord("Currencys", "curr_CurrencysId=" + currency);
                    string currname = currRec.GetFieldAsString("curr_des");
                    AddContent(HTML.InputHidden("currency", currname));
                }


                AddContent(HTML.InputHidden("exchange", exchange));
                string     hMode   = Dispatch.EitherField("HiddenMode");
                EntryGroup QDEntry = new EntryGroup("QuotationDetailNewEntry");
                QDEntry.Title = "报价明细";
                int errflag = 0;
                AddTabHead("QuotationDetail");
                if (hMode == "Save")
                {
                    Record QDRec = new Record("QuotationDetail");
                    QDEntry.Fill(QDRec);
                    if (QDEntry.Validate() == true)
                    {
                        QDRec.SetField("qtdt_qutaid", qutaid);
                        QDRec.SaveChanges();

                        QuerySelect qs = this.GetQuery();
                        qs.SQLCommand = @"Update Quotation set quta_localeamount = (select sum(qtdt_localeamount) from QuotationDetail where qtdt_deleted is null and qtdt_qutaid= " + qutaid + @")
                        ,quta_foreignamount =  (select sum(qtdt_foreignamount) from QuotationDetail where qtdt_deleted is null and qtdt_qutaid= " + qutaid + @")    where quta_Quotationid=" + qutaid;
                        qs.ExecuteNonQuery();
                        Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + qutaid);
                    }
                }
                if (errflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    QDEntry.GetHtmlInEditMode();
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(QDEntry);
                    AddContent(vp);

                    string url = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    AddSubmitButton("Save", "Save.gif", url);
                    AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + qutaid);
                }
            }
            catch (Exception ex)
            {
                AddError(ex.Message + "USAddPage");
            }
        }
Ejemplo n.º 27
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());

                EntryGroup qutacompEntry = new EntryGroup("QuotationCompanyEntry");
                qutacompEntry.Title = "商机客户";
                EntryGroup qutaEntry = new EntryGroup("QuotationNewEntry");
                qutaEntry.Title = "报价信息";
                string oppoid = Dispatch.EitherField("oppo_OpportunityId");
                if (string.IsNullOrEmpty(oppoid))
                {
                    oppoid = Dispatch.EitherField("key7");
                }
                AddTabHead("Quotation");
                int    errflag = 0;
                string errmsg  = string.Empty;
                string hMode   = Dispatch.EitherField("HiddenMode");
                if (hMode == "Save")
                {
                    Record QutaRec = new Record("Quotation");
                    qutacompEntry.Fill(QutaRec);
                    int days = Convert.ToInt32(Dispatch.ContentField("quta_days"));
                    if (days < 3)
                    {
                        //AddError(days.ToString());
                        errflag = 1;
                        errmsg  = "交货天数不可小于3天!";
                    }
                    string quta_oppoid   = Dispatch.ContentField("quta_opportunityid");
                    string quta_qutatype = Dispatch.ContentField("quta_qutatype");
                    if (string.IsNullOrEmpty(quta_oppoid) && quta_qutatype != "1" && quta_qutatype != "2")
                    {
                        errflag = 1;
                        errmsg  = "请选择商机!";
                    }


                    qutaEntry.Fill(QutaRec);
                    if (qutaEntry.Validate() == true && qutacompEntry.Validate() && errflag == 0)
                    {
                        string   code  = "C";
                        DateTime now   = DateTime.Now;
                        string   year  = now.Year.ToString();
                        string   month = now.Month.ToString();
                        string   day   = now.Day.ToString();
                        code += year + month + day;
                        QuerySelect qs = this.GetQuery();
                        qs.SQLCommand = "Select Count(*)+1 as cnt from Quotation where quta_code like '" + code + "%'";
                        qs.ExecuteReader();
                        int cnt = 0;
                        if (!qs.Eof())
                        {
                            cnt = Convert.ToInt32(qs.FieldValue("cnt"));
                        }
                        code += "9" + cnt.ToString().PadLeft(4, '0');

                        QutaRec.SetField("quta_code", code);
                        //QutaRec.SetField("quta_OpportunityId",oppoid);
                        QutaRec.SaveChanges();

                        //QuerySelect qs = this.GetQuery();
                        if ((quta_qutatype == "1" || quta_qutatype == "2") && string.IsNullOrEmpty(quta_oppoid))
                        {
                            //create opportunity
                            string opponame       = "报价单" + code + "自动生成商机";
                            string oppo_type      = "3";//订货
                            string oppo_countryin = Dispatch.ContentField("quta_type");
                            switch (oppo_countryin)
                            {
                            case "2101": oppo_countryin = "in";
                                break;

                            case "2102": oppo_countryin = "out";
                                break;

                            default: oppo_countryin = "in"; break;
                            }
                            string oppo_assigneduserid   = Dispatch.ContentField("quta_userid");
                            string oppo_stage            = "payment";
                            string oppo_status           = "In Progress";
                            string oppo_certainty        = "100";
                            string oppo_primarycompanyid = Dispatch.ContentField("quta_companyid");
                            Record OppoRec = new Record("Opportunity");
                            OppoRec.SetField("oppo_type", oppo_type);
                            OppoRec.SetField("oppo_description", opponame);
                            OppoRec.SetField("oppo_countryin", oppo_countryin);
                            OppoRec.SetField("oppo_assigneduserid", oppo_assigneduserid);
                            OppoRec.SetField("oppo_stage", oppo_stage);
                            OppoRec.SetField("oppo_status", oppo_status);
                            OppoRec.SetField("oppo_certainty", oppo_certainty);
                            OppoRec.SetField("oppo_primarycompanyid", oppo_primarycompanyid);
                            OppoRec.SetField("oppo_createdate", DateTime.Now);
                            OppoRec.SaveChanges();

                            quta_oppoid = OppoRec.RecordId.ToString();
                            QutaRec.SetField("quta_OpportunityId", quta_oppoid);
                            QutaRec.SaveChanges();
                        }

                        string quta_opportunityid = QutaRec.GetFieldAsString("quta_opportunityid");
                        qs.SQLCommand = "Update Opportunity set oppo_qutaprice= (select sum(quta_localeamount) from Quotation where quta_deleted is null and quta_updateoppo = 'Y' and quta_opportunityid = " + quta_opportunityid + " ) where oppo_Opportunityid =" + quta_opportunityid;
                        qs.ExecuteNonQuery();
                        Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "RunDataPage") + "&quta_Quotationid=" + QutaRec.RecordId.ToString());
                    }
                }
                if (errflag != -1)
                {
                    if (errflag == 1)
                    {
                        AddError(errmsg);
                    }
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    qutacompEntry.GetHtmlInEditMode();
                    qutaEntry.GetHtmlInEditMode();
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(qutacompEntry);
                    vp.Add(qutaEntry);
                    AddContent(vp);
                    AddSubmitButton("Save", "Save.gif", "javascript:document.EntryForm.HiddenMode.value='Save';");
                    string url = string.Empty;
                    if (string.IsNullOrEmpty(oppoid))
                    {
                        url = UrlDotNet("SalesMenu", "RunQuotation") + "&J=Quotation&T=SalesManagement";
                    }
                    else
                    {
                        url = UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoTrack&T=Opportunity";
                    }
                    AddUrlButton("Cancel", "Cancel.gif", url);
                }
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
Ejemplo n.º 28
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode             = Dispatch.EitherField("HiddenMode");
                string     brra_BrandRateId  = Dispatch.EitherField("brra_BrandRateId");
                int        errorflag         = 0;
                string     errormessage      = string.Empty;
                Record     BrandRate         = FindRecord("BrandRate", "brra_BrandRateId=" + brra_BrandRateId);
                string     maif_MarketInfoId = BrandRate.GetFieldAsString("brra_marketinfoid");
                EntryGroup BrandRateNewEntry = new EntryGroup("BrandRateNewEntry");
                BrandRateNewEntry.Fill(BrandRate);
                Entry IntentionOrderidEntry = BrandRateNewEntry.GetEntry("brra_marketinfoid");

                IntentionOrderidEntry.ReadOnly = true;

                AddTabHead("BrandRate");
                if (hMode == "Save")
                {
                    ////double original =BrandRate.GetFieldAsDouble("");
                    BrandRateNewEntry.Fill(BrandRate);
                    ////double  =BrandRate.GetFieldAsDouble("");

                    if (BrandRateNewEntry.Validate())
                    {
                        BrandRate.SaveChanges();

                        ////Record MarketInfo= FindRecord("MarketInfo", "maif_MarketInfoId=" + maif_MarketInfoId);
                        ////double  = MarketInfo.GetFieldAsDouble("");
                        //// =  + - original;
                        ////MarketInfo.SetField("", );
                        ////MarketInfo.SaveChanges();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&maif_MarketInfoId=" + maif_MarketInfoId + "&J=Summary";
                        url = url.Replace("Key37", "BrandRateid");
                        url = url + "&Key37=" + maif_MarketInfoId;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    BrandRateNewEntry.GetHtmlInEditMode(BrandRate);
                    vpMainPanel.Add(BrandRateNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunBrandRateDelete") + "&brra_BrandRateId=" + brra_BrandRateId;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&maif_MarketInfoId=" + maif_MarketInfoId + "&J=Summary";
                    url = url.Replace("Key37", "BrandRateid");
                    url = url + "&Key37=" + maif_MarketInfoId;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 29
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string hMode = Dispatch.EitherField("HiddenMode");
                string code_ContractDetailId = Dispatch.EitherField("code_ContractDetailId");
                int    errorflag             = 0;
                string errormessage          = string.Empty;
                Record ContractDetail        = FindRecord("ContractDetail", "code_ContractDetailId=" + code_ContractDetailId);
                double originalcode_money    = ContractDetail.GetFieldAsDouble("code_money");
                double originalcode_qty      = ContractDetail.GetFieldAsDouble("code_qty");

                string     cont_ContractId        = ContractDetail.GetFieldAsString("code_contractid");
                EntryGroup ContractDetailNewEntry = new EntryGroup("ContractDetailNewEntry");
                ContractDetailNewEntry.Fill(ContractDetail);
                Entry IntentionOrderidEntry = ContractDetailNewEntry.GetEntry("code_contractid");
                IntentionOrderidEntry.ReadOnly = true;

                AddTabHead("ContractDetail");
                if (hMode == "Save")
                {
                    ContractDetailNewEntry.Fill(ContractDetail);
                    double code_money = ContractDetail.GetFieldAsDouble("code_money");
                    double code_qty   = ContractDetail.GetFieldAsDouble("code_qty");

                    if (ContractDetailNewEntry.Validate())
                    {
                        ContractDetail.SaveChanges();

                        Record Contract    = FindRecord("Contract", "cont_ContractId=" + cont_ContractId);
                        double cont_amount = Contract.GetFieldAsDouble("cont_amount");
                        double cont_qty    = Contract.GetFieldAsDouble("cont_qty");

                        cont_amount = cont_amount + code_money - originalcode_money;
                        cont_qty    = cont_qty + code_qty - originalcode_qty;

                        Contract.SetField("cont_amount", cont_amount);
                        Contract.SetField("cont_qty", cont_qty);
                        Contract.SaveChanges();

                        double code_targetmoney = ContractDetail.GetFieldAsDouble("code_targetmoney");
                        if (code_targetmoney == 0)
                        {
                            code_targetmoney = 1;
                        }
                        double code_targetqty = ContractDetail.GetFieldAsDouble("code_targetqty");
                        if (code_targetqty == 0)
                        {
                            code_targetqty = 1;
                        }

                        ContractDetail.SetField("code_moneyrate", code_money / code_targetmoney);
                        ContractDetail.SetField("code_qtyrate", code_qty / code_targetqty);
                        ContractDetail.SaveChanges();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cont_ContractId=" + cont_ContractId + "&J=Summary";
                        url = url.Replace("Key37", "ContractDetailid");
                        url = url + "&Key37=" + cont_ContractId;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    ContractDetailNewEntry.GetHtmlInEditMode(ContractDetail);
                    vpMainPanel.Add(ContractDetailNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunContractDetailDelete") + "&code_ContractDetailId=" + code_ContractDetailId;
                    base.AddUrlButton("Delete", "Delete.gif", urldelete);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&cont_ContractId=" + cont_ContractId + "&J=Summary";
                    url = url.Replace("Key37", "ContractDetailid");
                    url = url + "&Key37=" + cont_ContractId;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 30
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode              = Dispatch.EitherField("HiddenMode");
                string     mopl_MonthPlanId   = Dispatch.EitherField("mopl_MonthPlanId");
                int        errorflag          = 0;
                string     errormessage       = string.Empty;
                EntryGroup PlanDetailNewEntry = new EntryGroup("PlanDetailNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry bred_busreportidEntry = PlanDetailNewEntry.GetEntry("plde_monthplanid");
                if (bred_busreportidEntry != null)
                {
                    bred_busreportidEntry.DefaultValue = mopl_MonthPlanId;
                    bred_busreportidEntry.ReadOnly     = true;
                }

                AddTabHead("DecoratePerson");
                if (hMode == "Save")
                {
                    Record PlanDetail = new Record("PlanDetail");
                    PlanDetailNewEntry.Fill(PlanDetail);
                    if (PlanDetailNewEntry.Validate())
                    {
                        PlanDetail.SaveChanges();
                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + mopl_MonthPlanId + "&J=Summary";
                        url = url.Replace("Key37", "DecorateCompid");
                        url = url + "&Key37=" + mopl_MonthPlanId;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    if (errorflag == 2)
                    {
                        AddError(errormessage);
                    }

                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    PlanDetailNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(PlanDetailNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + mopl_MonthPlanId + "&J=Summary";
                    url = url.Replace("Key37", "DecoratePersonid");
                    url = url + "&Key37=" + mopl_MonthPlanId;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
Ejemplo n.º 31
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode                 = Dispatch.EitherField("HiddenMode");
                string     comp_companyid        = Dispatch.EitherField("comp_companyid");
                int        errorflag             = 0;
                string     errormessage          = string.Empty;
                EntryGroup ProcessMethodNewEntry = new EntryGroup("ProcessMethodNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry bred_busreportidEntry = ProcessMethodNewEntry.GetEntry("pmet_companyid");
                if (bred_busreportidEntry != null)
                {
                    bred_busreportidEntry.DefaultValue = comp_companyid;
                    bred_busreportidEntry.ReadOnly     = true;
                }

                AddTabHead("ProcessMethod");
                if (hMode == "Save")
                {
                    Record ProcessMethod = new Record("ProcessMethod");
                    ProcessMethodNewEntry.Fill(ProcessMethod);
                    if (ProcessMethodNewEntry.Validate())
                    {
                        ProcessMethod.SaveChanges();
                        string pmet_ProcessMethodid = ProcessMethod.RecordId.ToString();
                        string url = UrlDotNet(ThisDotNetDll, "RunProcessMethodSummary") + "&pmet_ProcessMethodid=" + pmet_ProcessMethodid + "&J=Summary";
                        url = url.Replace("Key37", "ProcessMethodid");
                        url = url + "&Key37=" + pmet_ProcessMethodid;
                        Dispatch.Redirect(url);
                        errorflag = -1;
                    }
                    else
                    {
                        errorflag = 1;
                    }
                }
                if (errorflag != -1)
                {
                    if (errorflag == 2)
                    {
                        AddError(errormessage);
                    }

                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
                    ProcessMethodNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(ProcessMethodNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string url = UrlDotNet("Company", "RunProcessMethodList") + "&comp_companyid=" + comp_companyid + "&J=Summary";
                    url = url.Replace("Key37", "ProcessMethodid");
                    url = url + "&Key37=" + comp_companyid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }