예제 #1
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());
            try
            {
                string hMode          = Dispatch.EitherField("HiddenMode");
                string id             = Dispatch.EitherField("code_ContractDetailId");
                int    errorflag      = 0;
                string errormessage   = string.Empty;
                Record ContractDetail = FindRecord("ContractDetail", "code_ContractDetailId=" + id);
                double code_money     = ContractDetail.GetFieldAsDouble("code_money");
                double code_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");

                AddTabHead("Delete ContractDetail");
                if (hMode == "Delete")
                {
                    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;
                    cont_qty    = cont_qty - code_qty;

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

                    ContractDetail.DeleteRecord = true;
                    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);
                }
                if (errorflag != -1)
                {
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    VerticalPanel vpMainPanel = new VerticalPanel();
                    vpMainPanel.AddAttribute("width", "100%");
                    string sUrl = "javascript:document.EntryForm.HiddenMode.value='Delete';";
                    ContractDetailNewEntry.GetHtmlInViewMode(ContractDetail);
                    vpMainPanel.Add(ContractDetailNewEntry);
                    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);
            }
        }
예제 #2
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

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

                AddTabHead("DecoratePerson");
                if (hMode == "Save")
                {
                    Record DecoratePerson = new Record("DecoratePerson");
                    DecoratePersonNewEntry.Fill(DecoratePerson);
                    if (DecoratePersonNewEntry.Validate())
                    {
                        DecoratePerson.SaveChanges();
                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&dcom_DecorateCompId=" + dcom_decoratecompId + "&J=Summary";
                        url = url.Replace("Key37", "DecorateCompid");
                        url = url + "&Key37=" + dcom_decoratecompId;
                        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';";
                    DecoratePersonNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(DecoratePersonNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&dcom_DecorateCompId=" + dcom_decoratecompId + "&J=Summary";
                    url = url.Replace("Key37", "DecorateCompid");
                    url = url + "&Key37=" + dcom_decoratecompId;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
예제 #3
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                //string compid = Dispatch.EitherField("comp_companyid");
                EntryGroup CompEntry = new EntryGroup("CompanyBoxLong");
                CompEntry.Title = "基础信息";
                EntryGroup DealEntry = new EntryGroup("CompanyDealEntry");
                DealEntry.Title = "交易信息";
                EntryGroup StatusEntry = new EntryGroup("CompanyStatusEntry");
                StatusEntry.Title = "状态信息";

                EntryGroup AddrEntry = new EntryGroup("CompanyAddressEntry");
                AddrEntry.Title = "地址信息";

                AddTabHead("Company");
                int    errflag = 0;
                string errmsg  = string.Empty;
                string hMode   = Dispatch.EitherField("HiddenMode");
                if (hMode == "Save")
                {
                    Record CompRec = new Record("Company");
                    CompEntry.Fill(CompRec);
                    DealEntry.Fill(CompRec);
                    string comp_fullname  = CompRec.GetFieldAsString("comp_fullname");
                    string comp_shortname = CompRec.GetFieldAsString("comp_shortname");

                    QuerySelect qs = this.GetQuery();
                    qs.SQLCommand = "select count(*) as cnt from Company where comp_deleted is null and (comp_shortname = '" + comp_shortname + "' or comp_name = '" + comp_fullname + "')";
                    qs.ExecuteReader();
                    int cnt = -1;
                    if (!qs.Eof())
                    {
                        cnt = Convert.ToInt32(qs.FieldValue("cnt"));
                    }

                    if (cnt > 0)
                    {
                        errflag = 1;
                        errmsg  = "存在重复客户!";
                    }

                    if (CompEntry.Validate() == true && DealEntry.Validate() && DealEntry.Validate() == true && StatusEntry.Validate() && errflag == 0)
                    {
                        string   code  = "CRM";
                        DateTime dt    = DateTime.Now;
                        string   year  = dt.Year.ToString().Substring(2, 2);
                        string   month = dt.Month.ToString();
                        code += year + month;
                        //QuerySelect qs = this.GetQuery();
                        qs.SQLCommand = "select count(*) as cnt from Company where comp_deleted is null and comp_code like '" + code + "%'";
                        qs.ExecuteReader();
                        string count = qs.FieldValue("cnt").PadLeft(5, '0');
                        code += count;
                        CompRec.SetField("comp_code", code);
                        CompRec.SaveChanges();
                        Record AddrRec = new Record("Address");
                        AddrEntry.Fill(AddrRec);

                        if (AddrEntry.Validate())
                        {
                            AddrRec.SaveChanges();
                        }
                        Dispatch.Redirect(Url("200") + "&key0=1&key1=" + CompRec.RecordId.ToString() + "&J=Summary&T=Company&comp_companyid=" + CompRec.RecordId.ToString());
                    }
                }
                if (errflag != -1)
                {
                    if (errflag != 0)
                    {
                        AddError(errmsg);
                    }
                    AddContent(HTML.InputHidden("HiddenMode", ""));
                    CompEntry.GetHtmlInEditMode();
                    DealEntry.GetHtmlInEditMode();
                    //StatusEntry.GetHtmlInEditMode();
                    VerticalPanel vp = new VerticalPanel();
                    vp.AddAttribute("width", "100%");
                    vp.Add(CompEntry);
                    vp.Add(DealEntry);
                    //vp.Add(StatusEntry);
                    AddContent(vp);
                    AddSubmitButton("Save", "Save.gif", "javascript:document.EntryForm.HiddenMode.value='Save';");
                    AddUrlButton("Cancel", "Cancel.gif", UrlDotNet(ThisDotNetDll, "RunListPage") + "&T=CompanyList");
                }
            }
            catch (Exception error)
            {
                this.AddError(error.Message);
            }
        }
예제 #4
0
        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;
                EntryGroup ContractDetailNewEntry = new EntryGroup("ContractDetailNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry code_contractidEntry = ContractDetailNewEntry.GetEntry("code_contractid");


                if (code_contractidEntry != null)
                {
                    code_contractidEntry.DefaultValue = cont_ContractId;
                    code_contractidEntry.ReadOnly     = true;
                    //code_contractidEntry.Hidden = true;
                }
                AddTabHead("ContractDetail");
                if (hMode == "Save")
                {
                    Record ContractDetail = new Record("ContractDetail");
                    ContractDetailNewEntry.Fill(ContractDetail);
                    if (ContractDetailNewEntry.Validate())
                    {
                        //int cnt = 0;
                        //QuerySelect check = new QuerySelect();
                        //check.SQLCommand = "select COUNT(*) as cnt from ContractDetail where (code_contractid=" + cont_ContractId + " and code_productname='" + ContractDetail.GetFieldAsString("code_productname") + "' and code_price = '" + ContractDetail.GetFieldAsString("code_price") + "' and code_day = '" + ContractDetail.GetFieldAsString("code_day") + "' and code_time ='" + ContractDetail.GetFieldAsString("code_time") + "' and code_money ='" + ContractDetail.GetFieldAsString("code_money") + "'and code_lecturer = '" + ContractDetail.GetFieldAsString("code_lecturer") + "' and code_lecturername ='" + ContractDetail.GetFieldAsString("code_lecturername") + "' and code_students = '" + ContractDetail.GetFieldAsString("code_students") + "' and code_place ='" + ContractDetail.GetFieldAsString("code_place") + "' and code_startdate = '" + ContractDetail.GetFieldAsString("code_startdate") + "' and code_enddate = '" + ContractDetail.GetFieldAsString("code_enddate") + "'and code_deleted is null) or (code_contractid=" + cont_ContractId + "and code_lecturername='" + ContractDetail.GetFieldAsString("code_lecturername") + "'and code_startdate = '" + ContractDetail.GetFieldAsString("code_startdate") + "'and code_enddate = '" + ContractDetail.GetFieldAsString("code_enddate") + "'and code_deleted is null) or (code_contractid=" + cont_ContractId + " and code_lecturername='" + ContractDetail.GetFieldAsString("code_lecturername") + "'and ((code_startdate>'" + ContractDetail.GetFieldAsString("code_startdate") + "'and code_startdate<'" + ContractDetail.GetFieldAsString("code_enddate") + "') or(code_enddate>'" + ContractDetail.GetFieldAsString("code_startdate") + "'and code_enddate<'" + ContractDetail.GetFieldAsString("code_enddate") + "'))and code_deleted is null) or (code_contractid=" + cont_ContractId + "and code_lecturername='" + ContractDetail.GetFieldAsString("code_lecturername") + "'and (code_startdate between '" + ContractDetail.GetFieldAsString("code_startdate") + "' and '" + ContractDetail.GetFieldAsString("code_enddate") + "'or code_enddate between '" + ContractDetail.GetFieldAsString("code_startdate") + "' and '" + ContractDetail.GetFieldAsString("code_enddate") + "')and code_deleted is null)";
                        //check.ExecuteReader();
                        //if (!check.Eof())
                        //{
                        //    cnt = Convert.ToInt32(check.FieldValue("cnt"));
                        //}
                        //if (cnt > 0)
                        //{
                        //    errorflag = 2;
                        //    errormessage = "与上一条明细完全一致或老师日期有重叠!";
                        //}
                        //else
                        //{
                        ContractDetail.SaveChanges();
                        Record Contract          = FindRecord("Contract", "cont_ContractId=" + cont_ContractId);
                        double cont_amount       = Contract.GetFieldAsDouble("cont_amount");
                        double cont_qty          = Contract.GetFieldAsDouble("cont_qty");
                        double cont_discount     = Contract.GetFieldAsDouble("cont_discount");
                        double cont_salediscount = Contract.GetFieldAsDouble("cont_salediscount");

                        double code_money       = ContractDetail.GetFieldAsDouble("code_money");
                        double code_qty         = ContractDetail.GetFieldAsDouble("code_qty");
                        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;
                        }
                        cont_amount = cont_amount + code_money;
                        cont_qty    = cont_qty + code_qty;
                        //double cont_discountamount = cont_amount - cont_discount;
                        Contract.SetField("cont_amount", cont_amount);
                        Contract.SetField("cont_qty", cont_qty);
                        //Contract.SetField("cont_discountamount", cont_discountamount);
                        ContractDetail.SetField("code_moneyrate", code_money / code_targetmoney);
                        ContractDetail.SetField("code_qtyrate", code_qty / code_targetqty);
                        ContractDetail.SaveChanges();
                        Contract.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)
                {
                    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';";
                    ContractDetailNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(ContractDetailNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.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);
            }
        }
예제 #5
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try {
                string hMode             = Dispatch.EitherField("HiddenMode");
                string mapl_maractpoolid = Dispatch.EitherField("mapl_maractpoolid");
                if (string.IsNullOrEmpty(mapl_maractpoolid))
                {
                    mapl_maractpoolid = Dispatch.EitherField("Key58");
                }
                int        errorflag          = 0;
                string     errormessage       = string.Empty;
                EntryGroup MarActPlanNewEntry = new EntryGroup("MarActPlanNewEntry");
                //CostAdjustmentProductNewEntry.Title = "Add CostAdjustmentProduct";
                Entry mapl_maractpoolidEntry = MarActPlanNewEntry.GetEntry("mapl_maractpoolid");
                if (mapl_maractpoolidEntry != null)
                {
                    mapl_maractpoolidEntry.DefaultValue = mapl_maractpoolid;
                    mapl_maractpoolidEntry.ReadOnly     = true;
                }

                AddTabHead("MarActPlan");
                if (hMode == "Save")
                {
                    Record MarActPlan = new Record("MarActPlan");
                    MarActPlanNewEntry.Fill(MarActPlan);
                    if (MarActPlanNewEntry.Validate())
                    {
                        MarActPlan.SaveChanges();

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&mapl_maractplanid=" + MarActPlan.RecordId + "&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';";
                    MarActPlanNewEntry.GetHtmlInEditMode();
                    vpMainPanel.Add(MarActPlanNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    AddUrlButton("Cancel", "cancel.gif", UrlDotNet(ThisDotNetDll, "RunListPage"));
                }
            } catch (Exception e) {
                AddError(e.Message);
            }
        }
예제 #6
0
        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;

                    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);
            }
        }
예제 #7
0
        public override void BuildContents()
        {
            AddContent(HTML.Form());

            try
            {
                string     hMode = Dispatch.EitherField("HiddenMode");
                string     sede_ServiceDealid   = Dispatch.EitherField("sede_ServiceDealid");
                int        errorflag            = 0;
                string     errormessage         = string.Empty;
                Record     ServiceDeal          = FindRecord("ServiceDeal", "sede_ServiceDealid=" + sede_ServiceDealid);
                string     sede_serviceacceptid = ServiceDeal.GetFieldAsString("sede_serviceacceptid");
                EntryGroup ServiceDealNewEntry  = new EntryGroup("ServiceDealNewEntry");
                ServiceDealNewEntry.Fill(ServiceDeal);
                Entry IntentionOrderidEntry = ServiceDealNewEntry.GetEntry("sede_serviceacceptid");

                IntentionOrderidEntry.ReadOnly = true;

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

                    if (ServiceDealNewEntry.Validate())
                    {
                        ServiceDeal.SaveChanges();

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

                        string url = UrlDotNet(ThisDotNetDll, "RunDataPage") + "&seac_ServiceAcceptId=" + sede_serviceacceptid + "&J=Summary";
                        url = url.Replace("Key37", "ServiceDealid");
                        url = url + "&Key37=" + sede_serviceacceptid;
                        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';";
                    ServiceDealNewEntry.GetHtmlInEditMode(ServiceDeal);
                    vpMainPanel.Add(ServiceDealNewEntry);
                    AddContent(vpMainPanel);
                    AddSubmitButton("Save", "Save.gif", sUrl);
                    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 + "&J=Summary";
                    url = url.Replace("Key37", "ServiceDealid");
                    url = url + "&Key37=" + sede_serviceacceptid;
                    AddUrlButton("Cancel", "cancel.gif", url);
                }
            }
            catch (Exception e)
            {
                AddError(e.Message);
            }
        }
예제 #8
0
        public override void BuildContents()
        {
            try
            {
                AddContent(HTML.Form());
                string qutaid = Dispatch.EitherField("quta_Quotationid");
                if (string.IsNullOrEmpty(qutaid))
                {
                    qutaid = Dispatch.EitherField("key37");
                }
                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     qdid    = Dispatch.EitherField("qtdt_QuotationDetailID");
                string     hMode   = Dispatch.EitherField("HiddenMode");
                EntryGroup QDEntry = new EntryGroup("QuotationDetailNewEntry");
                QDEntry.Title = "报价明细";
                Record QDRec   = FindRecord("QuotationDetail", "qtdt_QuotationDetailID=" + qdid);
                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();
                        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");
            }
        }