public override void BuildContents() { try { string ddet_DealerDetailid = Dispatch.EitherField("ddet_DealerDetailid"); Record DealerDetail = FindRecord("DealerDetail", "ddet_DealerDetailid=" + ddet_DealerDetailid); string ddet_monthplanid = DealerDetail.GetFieldAsString("ddet_monthplanid"); int userid = CurrentUser.UserId; string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunDealerDetailEdit") + "&ddet_DealerDetailid=" + ddet_DealerDetailid; Dispatch.Redirect(urledit); EntryGroup DecoratePersonNewEntry = new EntryGroup("DealerDetailNewEntry"); DecoratePersonNewEntry.Title = "DealerDetail"; DecoratePersonNewEntry.Fill(DealerDetail); VerticalPanel vpMainPanel = new VerticalPanel(); vpMainPanel.AddAttribute("width", "100%"); vpMainPanel.Add(DecoratePersonNewEntry); AddContent(vpMainPanel); string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunDealerDetailDelete") + "&ddet_DealerDetailid=" + ddet_DealerDetailid; base.AddUrlButton("Delete", "Delete.gif", urldelete); string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mopl_MonthPlanId=" + ddet_monthplanid; url = url.Replace("Key37", "DealerDetailid"); url = url + "&Key37=" + ddet_monthplanid; this.AddUrlButton("cancel", "PrevCircle.gif", url); } catch (Exception error) { this.AddError(error.Message); } }
// public AddressDataPageDelete() // : base("Follow", "foll_FollowID", "FollowNewEntry") // { // this.CancelButton = false; // this.DeleteButton = false; // } public override void BuildContents() { try { AddContent(HTML.Form()); string compid = string.Empty; string Addressid = Dispatch.EitherField("addr_AddressID"); Record rec = FindRecord("Address", "addr_AddressID=" + Addressid); EntryGroup Addressentry = new EntryGroup("CompanyAddressEntry"); Addressentry.Fill(rec); AddTabHead("Address"); //GetTabs("Address", "Address"); string hMode = Dispatch.EitherField("HiddenMode"); if (hMode == "Save") { //Record rec = base.FindCurrentRecord("Address"); rec.DeleteRecord = true; rec.SaveChanges(); Dispatch.Redirect(UrlDotNet("Company", "RunAddressList") + "&comp_companyid=" + compid); } /* Add your code here */ compid = Dispatch.EitherField("comp_companyid"); if (string.IsNullOrEmpty(compid)) { compid = Dispatch.EitherField("key1"); } /* Add your code here */ AddContent(HTML.InputHidden("HiddenMode", "")); Addressentry.GetHtmlInViewMode(rec); AddContent(Addressentry); AddSubmitButton("确认删除", "delete.gif", "javascript:document.EntryForm.HiddenMode.value='Save';"); AddUrlButton("Cancel", "Cancel.gif", UrlDotNet("Company", "RunAddressList") + "&comp_companyid=" + compid); } catch (Exception error) { this.AddError(error.Message); } }
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); } }
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); } }
public override void BuildContents() { try { string sede_ServiceDealid = Dispatch.EitherField("sede_ServiceDealid"); Record ServiceDeal = FindRecord("ServiceDeal", "sede_ServiceDealid=" + sede_ServiceDealid); string sede_serviceacceptid = ServiceDeal.GetFieldAsString("sede_serviceacceptid"); int userid = CurrentUser.UserId; string urledit = base.UrlDotNet(base.ThisDotNetDll, "RunServiceDealEdit") + "&sede_ServiceDealid=" + sede_ServiceDealid; Dispatch.Redirect(urledit); EntryGroup ServiceDealNewEntry = new EntryGroup("ServiceDealNewEntry"); ServiceDealNewEntry.Title = "ServiceDeal"; ServiceDealNewEntry.Fill(ServiceDeal); VerticalPanel vpMainPanel = new VerticalPanel(); vpMainPanel.AddAttribute("width", "100%"); vpMainPanel.Add(ServiceDealNewEntry); AddContent(vpMainPanel); string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunServiceDealDelete") + "&sede_ServiceDealid=" + sede_ServiceDealid; base.AddUrlButton("Delete", "Delete.gif", urldelete); string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&seac_ServiceAcceptId=" + sede_serviceacceptid; url = url.Replace("Key37", "ServiceDealid"); url = url + "&Key37=" + sede_serviceacceptid; this.AddUrlButton("cancel", "PrevCircle.gif", url); } catch (Exception error) { this.AddError(error.Message); } }
public override void BuildContents() { try { string compid = Dispatch.EitherField("key1"); /* Add your code here */ AddTabHead("Competitor"); this.EntryGroups[0].Title = "Competitor"; base.BuildContents(); if (string.IsNullOrEmpty(compid)) { AddUrlButton("Cancel", "cancel.gif", UrlDotNet("IntelligenceMenu", "RunCompetitor")); } else { AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=Competitor&T=Company"); } } catch (Exception error) { this.AddError(error.Message); } }
public override void BuildContents() { //throw new NotImplementedException(); int checkId = int.Parse(Dispatch.EitherField("clsv_ChecklistSlaveId")); Record checklistRecord = FindRecord("ChecklistSlave", "clsv_ChecklistSlaveId = " + checkId); switch (_checklistType) { case CheckTypee.Applicant: checklistRecord.SetField("clsv_Applicant", checklistRecord.GetFieldAsString("clsv_Applicant") == "Y" ? "N" : "Y"); break; case CheckTypee.Spouse: checklistRecord.SetField("clsv_Spouse", checklistRecord.GetFieldAsString("clsv_Spouse") == "Y" ? "N" : "Y"); break; } checklistRecord.SaveChanges(); Dispatch.Redirect(UrlDotNet(ThisDotNetDll, "FlispCheckListSlaveList")); }
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"); if (!string.IsNullOrEmpty(opportunityid)) { AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoCompetitor&T=Opportunity"); } else { AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunCompetitorListPage") + "&J=OppoCompetitor&T=Competitor"); } } catch (Exception error) { this.AddError(error.Message); } }
public override void BuildContents() { try { string dcom_DecorateCompId = Dispatch.EitherField("dcom_decoratecompId"); if (string.IsNullOrEmpty(dcom_DecorateCompId)) { dcom_DecorateCompId = Dispatch.EitherField("key58"); } Record DecorateComp = FindRecord("DecorateComp", "dcom_DecorateCompId=" + dcom_DecorateCompId); EntryGroup screenBusReport = new EntryGroup("DecorateCompNewEntry"); screenBusReport.Title = "DecorateComp"; screenBusReport.Fill(DecorateComp); // string status = Competitor.GetFieldAsString("cept_status"); VerticalPanel vpMainPanel = new VerticalPanel(); vpMainPanel.AddAttribute("width", "100%"); vpMainPanel.Add(screenBusReport); List DecoratePersonGrid = new List("DecoratePersonGrid"); DecoratePersonGrid.Filter = "dper_deleted is null and dper_decoratecompid=" + dcom_DecorateCompId; DecoratePersonGrid.RowsPerScreen = 500; DecoratePersonGrid.ShowNavigationButtons = true; DecoratePersonGrid.PadBottom = false; vpMainPanel.Add(DecoratePersonGrid); AddContent(vpMainPanel); AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&dcom_decoratecompId=" + dcom_DecorateCompId); AddUrlButton("Delete", "Delete.gif", UrlDotNet(ThisDotNetDll, "RunDataPageDelete") + "&dcom_decoratecompId=" + dcom_DecorateCompId); AddUrlButton("Add Person", "new.gif", UrlDotNet(ThisDotNetDll, "RunPersonAdd") + "&dcom_decoratecompId=" + dcom_DecorateCompId); AddUrlButton("Continue", "Continue.gif", UrlDotNet("MarketingMenu", "RunDecorateComp") + "&J=RunDecorateComp&T=MarketingManagement"); } catch (Exception error) { this.AddError(error.Message); } }
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"); } }
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); } }
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"); } }
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); } }
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); } }
public override void BuildContents() { AddContent(HTML.Form()); try { string hMode = Dispatch.EitherField("HiddenMode"); string optr_opportunityid = Dispatch.EitherField("Key7"); int errorflag = 0; string errormessage = string.Empty; EntryGroup OppoTrackNewEntry = new EntryGroup("OppoTrackNewEntry"); //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct"; Entry optr_opportunityidEntry = OppoTrackNewEntry.GetEntry("optr_opportunityid"); if (optr_opportunityidEntry != null && optr_opportunityid != null) { optr_opportunityidEntry.DefaultValue = optr_opportunityid; optr_opportunityidEntry.ReadOnly = true; } else { optr_opportunityidEntry.ReadOnly = false; } AddTabHead("OppoTrack"); if (hMode == "Save") { Record OppoTrack = new Record("OppoTrack"); OppoTrackNewEntry.Fill(OppoTrack); if (OppoTrackNewEntry.Validate()) { OppoTrack.SaveChanges(); QuerySelect qs = this.GetQuery(); string oppoid = OppoTrack.GetFieldAsString("optr_opportunityid"); qs.SQLCommand = @"Update Opportunity set oppo_nexttrackdate = (select MAX(optr_nexttrackdate) from OppoTrack where optr_deleted is null and optr_opportunityid=" + oppoid + @") ,oppo_trackdate = (select MAX(optr_date) from OppoTrack where optr_deleted is null and optr_opportunityid=" + oppoid + @" ) ,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=" + oppoid; qs.ExecuteNonQuery(); string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&optr_oppotrackid=" + OppoTrack.GetFieldAsString("optr_oppotrackid") + "&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';"; OppoTrackNewEntry.GetHtmlInEditMode(); vpMainPanel.Add(OppoTrackNewEntry); AddContent(vpMainPanel); AddSubmitButton("Save", "Save.gif", sUrl); string url = string.Empty; 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 e) { AddError(e.Message); } }
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); } }
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); } }
//public override void GetTabs() //{ // string strTopContent = "<TABLE WIDTH=100%><TR><TD CLASS=TOPHEADING WIDTH=60><IMG SRC='" + CurrentUser.VirtualImgPath() + "Icons/Equipment.gif' BORDER=0 ALIGN=MIDDLE></td><td CLASS=VIEWBOXCAPTION><SPAN CLASS=TOPCAPTION>竞争对手</SPAN></td></tr></table>"; // AddTopContent(strTopContent); // GetTabs("Competitor", "Summary"); //} public override void BuildContents() { try { string compid = Dispatch.EitherField("key1"); string cpet_competitorid = Dispatch.EitherField("cpet_competitorid"); if (string.IsNullOrEmpty(cpet_competitorid)) { cpet_competitorid = Dispatch.EitherField("key58"); } Record Competitor = FindRecord("Competitor", "cpet_competitorid=" + cpet_competitorid); EntryGroup screenBusReport = new EntryGroup("CompetitorNewEntry"); screenBusReport.Title = "Competitor"; screenBusReport.Fill(Competitor); // string status = Competitor.GetFieldAsString("cept_status"); VerticalPanel vpMainPanel = new VerticalPanel(); vpMainPanel.AddAttribute("width", "100%"); vpMainPanel.Add(screenBusReport); List CpetProductGrid = new List("CpetProductGrid"); CpetProductGrid.Filter = "cppr_deleted is null and cppr_competitorid=" + cpet_competitorid; CpetProductGrid.RowsPerScreen = 500; CpetProductGrid.ShowNavigationButtons = true; CpetProductGrid.PadBottom = false; vpMainPanel.Add(CpetProductGrid); List MarketActivityGrid = new List("MarketActivityGrid"); MarketActivityGrid.Filter = "mact_deleted is null and mact_competitorid=" + cpet_competitorid; MarketActivityGrid.RowsPerScreen = 500; MarketActivityGrid.ShowNavigationButtons = true; MarketActivityGrid.PadBottom = false; vpMainPanel.Add(MarketActivityGrid); List CompetitionPersonList = new List("CompetitionPersonList"); CompetitionPersonList.Filter = "dper_deleted is null and dper_competitorid=" + cpet_competitorid; CompetitionPersonList.RowsPerScreen = 500; CompetitionPersonList.ShowNavigationButtons = true; CompetitionPersonList.PadBottom = false; vpMainPanel.Add(CompetitionPersonList); AddContent(vpMainPanel); int userid = CurrentUser.UserId; //if (userid == 137 || userid == 43 || userid == 130 || CurrentUser.IsAdmin()) //{ AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&cpet_competitorid=" + cpet_competitorid); AddUrlButton("Delete", "Delete.gif", UrlDotNet(ThisDotNetDll, "RunDataPageDelete") + "&cpet_competitorid=" + cpet_competitorid); // } AddUrlButton("Add CpetProduct", "new.gif", UrlDotNet(ThisDotNetDll, "RunCpetProductAdd") + "&cpet_competitorid=" + cpet_competitorid); AddUrlButton("Add MarketActivity", "new.gif", UrlDotNet(ThisDotNetDll, "RunMarketActivityAdd") + "&cpet_competitorid=" + cpet_competitorid); AddUrlButton("Add Person", "new.gif", UrlDotNet(ThisDotNetDll, "RunPersonAdd") + "&cpet_competitorid=" + cpet_competitorid); if (string.IsNullOrEmpty(compid)) { AddUrlButton("Continue", "Continue.gif", UrlDotNet("IntelligenceMenu", "RunCompetitor") + "&J=Competitor&T=CompanyMangement"); } else { AddUrlButton("Continue", "Continue.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=Competitor&T=Company"); } //AddWorkflowButtons("Competitor"); } catch (Exception error) { this.AddError(error.Message); } }
//public ContractDataPageDelete() // : base("Contract", "cont_ContractId", "ContractNewEntry") //{ // this.EntryGroups[0].Title = "Contract"; // this.CancelMethod = "RunDataPage"; //} public override void BuildContents() { AddContent(HTML.Form()); try { string hMode = Dispatch.EitherField("HiddenMode"); string cont_ContractId = Dispatch.EitherField("cont_ContractId"); int errorflag = 0; string errormessage = string.Empty; Record Contract = FindRecord("Contract", "cont_ContractId=" + cont_ContractId); string type = Contract.GetFieldAsString("cont_type"); EntryGroup ContractNewEntry = new EntryGroup("ContractNewEntry"); ContractNewEntry.Fill(Contract); AddTabHead("Delete Contract"); if (hMode == "Delete") { Contract.DeleteRecord = true; Contract.SaveChanges(); QuerySelect check = new QuerySelect(); check.SQLCommand = "delete contractdetail where code_contractid=" + cont_ContractId; check.ExecuteNonQuery(); string url = UrlDotNet(ThisDotNetDll, "RunListPage"); 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';"; ContractNewEntry.GetHtmlInViewMode(Contract); vpMainPanel.Add(ContractNewEntry); if (type.ToLower() != "product") { List ContractDetailGrid = new List("ContractDetailGrid"); ContractDetailGrid.Filter = "code_deleted is null and code_contractid=" + cont_ContractId + " and code_isproduct='1'"; ContractDetailGrid.RowsPerScreen = 500; ContractDetailGrid.ShowNavigationButtons = true; ContractDetailGrid.PadBottom = false; vpMainPanel.Add(ContractDetailGrid); } else { List ContractDetailProduct = new List("ContractDetailProduct"); ContractDetailProduct.Filter = "code_deleted is null and code_contractid=" + cont_ContractId + " and code_isproduct='2'"; ContractDetailProduct.RowsPerScreen = 500; ContractDetailProduct.ShowNavigationButtons = true; ContractDetailProduct.PadBottom = false; vpMainPanel.Add(ContractDetailProduct); } AddContent(vpMainPanel); AddSubmitButton("ConfirmDelete", "Delete.gif", sUrl); 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); } }
public override void BuildContents() { AddContent(HTML.Form()); EntryGroup screenCompanyBoxLong = new EntryGroup("CompanyBoxLong"); screenCompanyBoxLong.Title = Metadata.GetTranslation("tabnames", "company"); EntryGroup screenPersonBoxLong = new EntryGroup("PersonBoxLong"); screenPersonBoxLong.Title = Metadata.GetTranslation("tabnames", "person"); EntryGroup screenOppo = new EntryGroup("OpportunityDetailBox"); screenOppo.Title = Metadata.GetTranslation("tabnames", "opportunity"); string hMode = Dispatch.EitherField("HiddenMode"); if (hMode == "Save") { Record recCompany = new Record("Company"); screenCompanyBoxLong.Fill(recCompany); recCompany.SaveChanges(); Record recPerson = new Record("Person"); recPerson.SetField("pers_companyid", recCompany.GetFieldAsInt("comp_companyid")); screenPersonBoxLong.Fill(recPerson); recPerson.SaveChanges(); recCompany.SetField("comp_primarypersonid", recPerson.GetFieldAsInt("pers_personid")); recCompany.SaveChanges(); Record recOppo = new Record("Opportunity"); recOppo.SetField("oppo_primarycompanyid", recCompany.GetFieldAsInt("comp_Companyid")); screenOppo.Fill(recOppo); recOppo.SaveChanges(); //redirect to the company summary of the new company string rUrl = Url("200"); string[] split = rUrl.Split(new char[] { '&' }); string newUrl = split[0] + '&' + split[1] + "&Mode=1&CLk=T&key0=7&key1=" + recCompany.GetFieldAsInt("comp_companyid"); Dispatch.Redirect(newUrl); } else { AddContent(HTML.InputHidden("HiddenMode", "")); VerticalPanel vpMainPanel = new VerticalPanel(); vpMainPanel.AddAttribute("width", "100%"); screenCompanyBoxLong.GetHtmlInEditMode(); screenPersonBoxLong.GetHtmlInEditMode(); screenOppo.GetHtmlInEditMode(); vpMainPanel.Add(screenCompanyBoxLong); vpMainPanel.Add(screenPersonBoxLong); vpMainPanel.Add(screenOppo); AddContent(vpMainPanel); //Add Buttons string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';"; AddSubmitButton("Save", "Save.gif", sUrl); AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunEntryScreen")); string strHelpUrl = "/Main Menu/Default_CSH.htm?href=AI_FAQs.html"; AddHelpButton(strHelpUrl); } }
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); } }
public override void BuildContents() { AddContent(HTML.Form()); try { string hMode = Dispatch.EitherField("HiddenMode"); string opco_OppoCompetitorId = Dispatch.EitherField("opco_OppoCompetitorId"); int errorflag = 0; string errormessage = string.Empty; Record OppoCompetitor = FindRecord("OppoCompetitor", "opco_OppoCompetitorId=" + opco_OppoCompetitorId); string opco_opportunityid = OppoCompetitor.GetFieldAsString("opco_opportunityid"); EntryGroup OppoCompetitorNewEntry = new EntryGroup("OppoCompetitorNewEntry"); OppoCompetitorNewEntry.Fill(OppoCompetitor); Entry opco_opportunityidEntry = OppoCompetitorNewEntry.GetEntry("opco_opportunityid"); //opco_opportunityidEntry.ReadOnly = true; //AddTabHead("CpetProduct"); GetTabs("OppoCompetitor", "Summary"); if (hMode == "Save") { ////double original =CpetProduct.GetFieldAsDouble(""); OppoCompetitorNewEntry.Fill(OppoCompetitor); ////double =CpetProduct.GetFieldAsDouble(""); if (OppoCompetitorNewEntry.Validate()) { OppoCompetitor.SaveChanges(); ////Record BusReport= FindRecord("BusReport", "cpet_competitorid=" + cpet_competitorid); ////double = BusReport.GetFieldAsDouble(""); //// = + - original; ////BusReport.SetField("", ); ////BusReport.SaveChanges(); string opportunityid = Dispatch.EitherField("Key7"); string url = string.Empty; if (!string.IsNullOrEmpty(opportunityid)) { url = UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoCompetitor&T=Opportunity"; } else { url = UrlDotNet(ThisDotNetDll, "RunCompetitorListPage") + "&J=OppoCompetitor&T=Competitor"; } 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';"; OppoCompetitorNewEntry.GetHtmlInEditMode(OppoCompetitor); vpMainPanel.Add(OppoCompetitorNewEntry); AddContent(vpMainPanel); AddSubmitButton("Save", "Save.gif", sUrl); string urldelete = base.UrlDotNet(base.ThisDotNetDll, "RunDataPageDelete") + "&opco_OppoCompetitorId=" + opco_OppoCompetitorId; base.AddUrlButton("Delete", "Delete.gif", urldelete); //string opportunityid = Dispatch.EitherField("Key7"); string url = string.Empty; url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&opco_OppoCompetitorId=" + opco_OppoCompetitorId; //if (!string.IsNullOrEmpty(opportunityid)) { // url = UrlDotNet(ThisDotNetDll, "RunListPage") + "&J=OppoCompetitor&T=Opportunity"; //} else { // url = UrlDotNet(ThisDotNetDll, "RunCompetitorListPage") + "&J=OppoCompetitor&T=Competitor"; //} AddUrlButton("Cancel", "cancel.gif", url); } } catch (Exception e) { AddError(e.Message); } }
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); } }
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)); } //报价单别 国内、国外 string inout = QutaRec.GetFieldAsString("quta_type"); AddContent(HTML.InputHidden("exchange", exchange)); string hMode = Dispatch.EitherField("HiddenMode"); EntryGroup QDEntry = new EntryGroup("QuotationDetailNewEntry"); QDEntry.Title = "报价明细"; int errflag = 0; AddTabHead("QuotationDetail"); string productinfoid = Dispatch.ContentField("qtdt_productinfoid"); double discount = 100; if (!string.IsNullOrEmpty(productinfoid) && productinfoid != "0") { Record prodRec = FindRecord("ProductInfo", "pdin_ProductInfoId=" + productinfoid); string Name = string.Empty; if (inout == "2101") { Name = prodRec.GetFieldAsString("pdin_Name"); } else { Name = prodRec.GetFieldAsString("pdin_Englishname"); } string Standard = prodRec.GetFieldAsString("pdin_standard"); string pdin_marketprice = prodRec.GetFieldAsString("pdin_marketprice"); //国内小类 string pdin_prodtypeid = prodRec.GetFieldAsString("pdin_prodtypeid"); if (string.IsNullOrEmpty(pdin_prodtypeid)) { pdin_prodtypeid = "0"; } //国外小类 string pdin_prodtype2 = prodRec.GetFieldAsString("pdin_prodtype2"); if (string.IsNullOrEmpty(pdin_prodtype2)) { pdin_prodtype2 = "0"; } //MOQ string MOQ = prodRec.GetFieldAsString("pdin_moq"); if (string.IsNullOrEmpty(MOQ)) { MOQ = "0"; } //客户折扣 根据报价产品所属产品小类,确认客户该小类折扣 string compid = QutaRec.GetFieldAsString("quta_companyid"); QuerySelect qs = this.GetQuery(); qs.SQLCommand = "select prpi_discount from ProductPrice where prpi_Deleted is null and prpi_Status = 'InProgress' and prpi_companyid = " + compid + " and (prpi_prodcategoryid = " + pdin_prodtypeid + " or prpi_prodcategoryid = " + pdin_prodtype2 + ")"; qs.ExecuteReader(); if (qs.Eof()) { discount = 100; } else { discount = Convert.ToDouble(qs.FieldValue("prpi_discount")); } //AddInfo(Name + "---" + Standard); for (int i = 0; i < QDEntry.Count; i++) { string field = QDEntry[i].Name; if (field == "qtdt_productname") { QDEntry[i].DefaultValue = Name; } else if (field == "qtdt_prodtype") { QDEntry[i].DefaultValue = Standard; } else if (field == "qtdt_discount") { QDEntry[i].DefaultValue = discount.ToString(); } else if (field == "qtdt_price") { QDEntry[i].DefaultValue = pdin_marketprice; } else if (field == "qtdt_moq") { QDEntry[i].DefaultValue = MOQ; } else { QDEntry[i].DefaultValue = Dispatch.ContentField(QDEntry[i].Name); } } } //int errflag = 0; string errmsg = ""; if (hMode == "Save") { Record QDRec = new Record("QuotationDetail"); QDEntry.Fill(QDRec); double dc = Convert.ToDouble(Dispatch.ContentField("qtdt_discount")); if (dc < discount && discount != 100) { errflag = 1; errmsg += "折扣率不可低于客户最低折扣!"; } if (QDEntry.Validate() == true && errflag == 0) { QDRec.SetField("qtdt_qutaid", qutaid); /*查找当前数据库中该产品最新价格 *必须在该条记录保存前查询 */ QuerySelect qs = this.GetQuery(); //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(); QDRec.SaveChanges(); string qtdtid = QDRec.RecordId.ToString(); qs.SQLCommand = "exec crm_UpdateOpportunityQutaPrice @quotationid=" + qutaid; qs.ExecuteNonQuery(); //更新报价明细序号 qs.SQLCommand = "Update QuotationDetail set qtdt_code=(select count(*) from QuotationDetail where qtdt_deleted is null and qtdt_qutaid=" + qutaid + ") where qtdt_QuotationDetailId = " + qtdtid; qs.ExecuteNonQuery(); //更新报价单上汇总价格 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, "RunQDAdd") + "&quta_Quotationid=" + qutaid); } } if (errflag != -1) { if (errflag == 1) { AddError(errmsg); } List UseList = new List("QuotationDetailGrid"); UseList.Filter = "qtdt_deleted is null and qtdt_qutaid =" + qutaid; UseList.PadBottom = false; UseList.RowsPerScreen = 50; AddContent(HTML.InputHidden("HiddenMode", "")); QDEntry.GetHtmlInEditMode(); VerticalPanel vp = new VerticalPanel(); vp.AddAttribute("width", "100%"); vp.Add(QDEntry); vp.Add(UseList); 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"); } }
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); } }
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"); List UseList = new List("QuotationDetailGrid"); UseList.Filter = "qtdt_deleted is null and qtdt_qutaid =" + qutaid; UseList.PadBottom = false; UseList.RowsPerScreen = 50; qutacompEntry.GetHtmlInViewMode(qutaRec); qutaEntry.GetHtmlInViewMode(qutaRec); VerticalPanel vp = new VerticalPanel(); vp.AddAttribute("width", "100%"); vp.Add(qutacompEntry); vp.Add(qutaEntry); vp.Add(UseList); AddContent(vp); //string quta_opportunityid = qutaRec.GetFieldAsString("quta_opportunityid"); //if (!string.IsNullOrEmpty(quta_opportunityid)) //{ // QuerySelect qs = this.GetQuery(); // 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(); //} AddUrlButton("Edit", "Edit.gif", UrlDotNet(ThisDotNetDll, "RunDataPageEdit") + "&quta_Quotationid=" + qutaid); AddUrlButton("添加报价明细", "New.gif", UrlDotNet(ThisDotNetDll, "RunQDAdd") + "&quta_Quotationid=" + qutaid); string url = string.Empty; string oppoid = Dispatch.EitherField("key7"); 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); AddWorkflowButtons("Quotation"); } catch (Exception error) { this.AddError(error.Message); } }
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); } }
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); } }
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); } }
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); } }