Пример #1
0
    /// <summary>
    /// This event is used to sort the contents of the grid
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public static void GridSort(HtmlInputHidden txthdnSortOrder, GridViewSortEventArgs e, GridView grdReport, int formName, object objCollection)
    {
        string strSortDir = null;

        try
        {
            //storing the value in hidden variable
            if (txthdnSortOrder.Value.Length == 0)
            {
                txthdnSortOrder.Value = e.SortDirection.ToString();
            }

            //To reverse the sort order
            if (txthdnSortOrder.Value.Length != 0)
            {
                if (txthdnSortOrder.Value == "Ascending")
                {
                    txthdnSortOrder.Value = "Descending";
                }
                else
                {
                    txthdnSortOrder.Value = "Ascending";
                }
            }

            //checking the condition and sorting accordingly
            switch (txthdnSortOrder.Value)
            {
                case "Ascending":
                    strSortDir = "ASC";
                    break;

                case "Descending":
                    strSortDir = "DESC";
                    break;
            }

            //Appending arrow symbol to the grid header according to the sorting.
            GridSorting.AppendSortOrderImageToGridHeader(txthdnSortOrder.Value, e.SortExpression, ref grdReport);
            GridSortingEx(formName, strSortDir, e.SortExpression, ref grdReport, objCollection);

            //Add data to the GridView
            //GridSorting.MakeAccessible(grdReport);
        }
        catch (Exception ex)
        {
            //bool rethrow = ExceptionPolicy.HandleException(ex, ARSConstants.StrPerDatumUIPolicy);

            //if (rethrow)
            //    throw;

            ////Redirecting to error message page
            //HttpContext.Current.Server.Transfer(ARSConstants.StrErrorPageURL);
        }
    }
Пример #2
0
    public static void GridSortForReport(HtmlInputHidden txthdnSortOrder, string eSortExp, GridView grdReport, int formName, object objCollection, string SortDirec)
    {
        string strSortDir = null;

        try
        {

            txthdnSortOrder.Value = SortDirec;

            //checking the condition and sorting accordingly
            switch (txthdnSortOrder.Value)
            {
                case "Ascending":
                    strSortDir = "ASC";
                    break;

                case "Descending":
                    strSortDir = "DESC";
                    break;
            }

            //Appending arrow symbol to the grid header according to the sorting.
            GridSorting.AppendSortOrderImageToGridHeader(txthdnSortOrder.Value, eSortExp, ref grdReport);
            GridSortingEx(formName, strSortDir, eSortExp, ref grdReport, objCollection);

            //Add data to the GridView
            //GridSorting.MakeAccessible(grdReport);
        }
        catch (Exception ex)
        {
            //bool rethrow = ExceptionPolicy.HandleException(ex, ARSConstants.StrPerDatumUIPolicy);

            //if (rethrow)
            //    throw;

            ////Redirecting to error message page
            //HttpContext.Current.Server.Transfer(ARSConstants.StrErrorPageURL);
        }
    }
        protected override void AttachChildControls()
        {
            int num2;
            int num3;

            this.litSurplusIntegral = (Literal)this.FindControl("litSurplusIntegral");
            this.litSumIntegral     = (Literal)this.FindControl("litSumIntegral");
            this.litStatus0         = (Literal)this.FindControl("litStatus0");
            this.litStatus1         = (Literal)this.FindControl("litStatus1");
            this.litStatus2         = (Literal)this.FindControl("litStatus2");
            this.littableList0      = (Literal)this.FindControl("littableList0");
            this.littableList1      = (Literal)this.FindControl("littableList1");
            this.littableList2      = (Literal)this.FindControl("littableList2");
            this.txtTotal           = (HtmlInputHidden)this.FindControl("txtTotal");
            this.txtShowTabNum      = (HtmlInputHidden)this.FindControl("txtShowTabNum");
            this.rptIntegarlDetail0 = (VshopTemplatedRepeater)this.FindControl("rptIntegarlDetail0");
            this.rptIntegarlDetail1 = (VshopTemplatedRepeater)this.FindControl("rptIntegarlDetail1");
            this.rptIntegarlDetail2 = (VshopTemplatedRepeater)this.FindControl("rptIntegarlDetail2");
            int num = 0;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out num2))
            {
                num2 = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num3))
            {
                num3 = 10;
            }
            IntegralDetailQuery query         = new IntegralDetailQuery();
            MemberInfo          currentMember = MemberProcessor.GetCurrentMember();

            this.litSurplusIntegral.Text = currentMember.Points.ToString();
            this.litSumIntegral.Text     = Convert.ToInt32(MemberProcessor.GetIntegral(currentMember.UserId)).ToString();
            query.UserId    = currentMember.UserId;
            query.PageIndex = num2;
            query.PageSize  = num3;
            if (int.TryParse(this.Page.Request.QueryString["IntegralSourceType"], out num))
            {
                if (num == 0)
                {
                    query.IntegralSourceType = num;
                    DbQueryResult integralDetail = MemberProcessor.GetIntegralDetail(query);
                    this.rptIntegarlDetail0.DataSource = integralDetail.Data;
                    this.rptIntegarlDetail0.DataBind();
                    this.litStatus0.Text    = "class=\"active\"";
                    this.litStatus1.Text    = "";
                    this.litStatus2.Text    = "";
                    this.littableList0.Text = "style=\"display: block;\"";
                    this.littableList1.Text = "style=\"display: none;\"";
                    this.littableList2.Text = "style=\"display: none;\"";
                    this.txtTotal.SetWhenIsNotNull(integralDetail.TotalRecords.ToString());
                }
                else if (num == 1)
                {
                    query.IntegralSourceType = num;
                    DbQueryResult result2 = MemberProcessor.GetIntegralDetail(query);
                    this.rptIntegarlDetail1.DataSource = result2.Data;
                    this.rptIntegarlDetail1.DataBind();
                    this.litStatus0.Text    = "";
                    this.litStatus1.Text    = "class=\"active\"";
                    this.litStatus2.Text    = "";
                    this.littableList0.Text = "style=\"display: none ;\"";
                    this.littableList1.Text = "style=\"display:block;\"";
                    this.littableList2.Text = "style=\"display: none;\"";
                    this.txtTotal.SetWhenIsNotNull(result2.TotalRecords.ToString());
                }
                else
                {
                    query.IntegralSourceType = num;
                    DbQueryResult result3 = MemberProcessor.GetIntegralDetail(query);
                    this.rptIntegarlDetail2.DataSource = result3.Data;
                    this.rptIntegarlDetail2.DataBind();
                    this.litStatus0.Text    = "";
                    this.litStatus1.Text    = "";
                    this.litStatus2.Text    = "class=\"active\"";
                    this.littableList0.Text = "style=\"display: none ;\"";
                    this.littableList1.Text = "style=\"display:none;\"";
                    this.littableList2.Text = "style=\"display: block;\"";
                    this.txtTotal.SetWhenIsNotNull(result3.TotalRecords.ToString());
                }
            }
            PageTitle.AddSiteNameTitle("积分明细");
        }
        public void InstantiateIn(System.Web.UI.Control container)
        {
            switch (templateType)
            {
            case ListItemType.Header:
                //System.Web.UI.WebControls.Button btnAdd = new System.Web.UI.WebControls.Button();
                LinkButton btnAdd = new LinkButton();
                btnAdd.CommandName = "_AddIssue";
                btnAdd.Text        = "Add&nbsp;New&nbsp;Issue";
                btnAdd.Font.Size   = 8;

                LinkButton btnRefresh = new LinkButton();
                btnRefresh.CommandName = "_RefreshIssueList";
                btnRefresh.Text        = "Refresh&nbsp;List";
                btnRefresh.Font.Size   = 8;

                Literal lcH1 = new Literal();
                lcH1.Text = "<TABLE class=\"CompactTable\"  style=\"BACKGROUND-COLOR: gainsboro\" cellpadding=\"0\" cellspacing=\"0\"><tr><th colspan=\"5\">Data&nbsp;Issues&nbsp;&nbsp;";
                Literal lcH2 = new Literal();
                lcH2.Text = "</th></TR>";
                Literal lcH3 = new Literal();
                lcH3.Text = "&nbsp;&nbsp;";

                container.Controls.Add(lcH1);
                container.Controls.Add(btnAdd);
                container.Controls.Add(lcH3);
                container.Controls.Add(btnRefresh);
                container.Controls.Add(lcH2);
                break;

            case ListItemType.Item:
            case ListItemType.AlternatingItem:

                System.Web.UI.WebControls.TextBox txtEntry = new System.Web.UI.WebControls.TextBox();
                txtEntry.ID           = "txtEntry";
                txtEntry.CssClass     = "IssueTxtEntry";
                txtEntry.TextMode     = TextBoxMode.MultiLine;
                txtEntry.MaxLength    = 1000;
                txtEntry.Rows         = 3;
                txtEntry.DataBinding += new EventHandler(TemplateControl_DataBinding);
                txtEntry.Font.Size    = 8;

                //System.Web.UI.WebControls.Button btnSave = new System.Web.UI.WebControls.Button();
                LinkButton btnSave = new LinkButton();
                btnSave.CommandName = "_SaveIssue";
                btnSave.Text        = "Save";
                btnSave.Font.Size   = 8;

                //System.Web.UI.WebControls.Button btnDelete = new System.Web.UI.WebControls.Button();
                LinkButton btnDelete = new LinkButton();
                btnDelete.CommandName = "_DeleteIssue";
                btnDelete.Text        = "Delete";
                btnDelete.Font.Size   = 8;

                System.Web.UI.WebControls.DropDownList lbStatus = new DropDownList();
                lbStatus.ID = "lbStatus";

                /*
                 * lbStatus.Items.Add(new ListItem("-none-","0"));
                 * lbStatus.Items.Add(new ListItem("Unresolved","1"));
                 * lbStatus.Items.Add(new ListItem("Resolved","2"));
                 * lbStatus.Items.Add(new ListItem("Note","3"));
                 */
                lbStatus.DataBinding += new EventHandler(TemplateControl_DataBinding);
                lbStatus.Font.Size    = 8;

                HtmlInputHidden hiddenIssueID = new HtmlInputHidden();
                hiddenIssueID.ID           = "hiddenIssueID";
                hiddenIssueID.DataBinding += new EventHandler(TemplateControl_DataBinding);

                /*
                 * Literal lcCreateUpdate = new Literal();
                 * lcCreateUpdate.ID = "lcCreateUpdate";
                 * lcCreateUpdate.DataBinding += new EventHandler(TemplateControl_DataBinding);
                 */
                Label lbCreateUpdate = new Label();
                lbCreateUpdate.ID           = "lbCreateUpdate";
                lbCreateUpdate.DataBinding += new EventHandler(TemplateControl_DataBinding);
                lbCreateUpdate.Font.Size    = 8;

                Literal lc1 = new Literal();
                Literal lc2 = new Literal();
                Literal lc3 = new Literal();
                Literal lc4 = new Literal();
                Literal lc5 = new Literal();
                Literal lc6 = new Literal();

                lc1.Text = "<tr class=\"CompactTableRow\"><td class=\"CompactTableCell\">";
                lc2.Text = "</td></tr>";
                lc3.Text = "</td><td class=\"CompactTableCell\">";
                lc4.Text = "</td><td class=\"CompactTableCell\">";
                lc5.Text = "</td><td class=\"CompactTableCell\">";
                lc6.Text = "&nbsp;";

                // add all controls to container--determines order of output
                container.Controls.Add(lc1);
                container.Controls.Add(hiddenIssueID);
                container.Controls.Add(lbStatus);
                container.Controls.Add(lc3);
                container.Controls.Add(txtEntry);
                container.Controls.Add(lc4);
                //container.Controls.Add(lcCreateUpdate);
                container.Controls.Add(lbCreateUpdate);
                container.Controls.Add(lc5);
                container.Controls.Add(btnSave);
                container.Controls.Add(lc6);
                container.Controls.Add(btnDelete);
                container.Controls.Add(lc2);
                break;

            case ListItemType.Footer:
                Literal lcF = new Literal();
                lcF.Text = "</TABLE>";
                container.Controls.Add(lcF);
                break;
            }
        }
Пример #5
0
    protected void btnPrint_Click(object sender, ImageClickEventArgs e)
    {
        string url = "PrintFYD.aspx";

        if (this.rdoReport.SelectedValue == "1")
        {
            url += "?TYPE=1";
            url += CreateParams();
            string strClient = "window.open(\"" + url + "\",\"\",\"toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=yes\")";
            this.WriteClientJava(strClient);
            return;
        }
        bool isCheck = false;

        foreach (GridViewRow row in this.grvFYD.Rows)
        {
            CheckBox        chBox   = (CheckBox)row.FindControl("chkCFYD");
            HtmlInputHidden hidFYDH = (HtmlInputHidden)row.FindControl("strFYDH");
            HtmlInputHidden hidYSLB = (HtmlInputHidden)row.FindControl("strYSLB");
            HtmlInputHidden hidCPH  = (HtmlInputHidden)row.FindControl("strCPH");
            if (chBox.Checked)
            {
                isCheck            = true;
                this.hidItem.Value = "";

                if (this.rdoReport.SelectedValue == "0")
                {
                    url += "?TYPE=0";
                    url += "&FYDH=" + hidFYDH.Value;
                    url += "&YSLB=" + hidYSLB.Value;
                    url += "&CPH=" + Server.UrlEncode(hidCPH.Value);
                    string strClient1 = "window.open(\"" + url + "\",\"\",\"toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=yes\")";
                    this.WriteClientJava(strClient1);
                    return;
                }
                if (this.rdoReport.SelectedValue == "2")
                {
                    url += "?TYPE=2";
                    url += "&FYDH=" + hidFYDH.Value;
                    url += "&YSLB=" + hidYSLB.Value;
                    url += "&CPH=" + Server.UrlEncode(hidCPH.Value);
                    string strClient1 = "window.open(\"" + url + "\",\"\",\"toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=yes\")";
                    this.WriteClientJava(strClient1);
                    return;
                }
                if (this.rdoReport.SelectedValue == "3")
                {
                    url += "?TYPE=3";
                    url += "&FYDH=" + hidFYDH.Value;
                    url += "&YSLB=" + hidYSLB.Value;
                    url += "&CPH=" + Server.UrlEncode(hidCPH.Value);
                    string strClient1 = "window.open(\"" + url + "\",\"\",\"toolbar=no,menubar=no,scrollbars=auto, resizable=yes,location=no, status=yes\")";
                    this.WriteClientJava(strClient1);
                    return;
                }
            }
        }
        this.hidItem.Value = "";
        if (isCheck == false)
        {
            PrintfError("没有选中要打印的发运单信息");
            return;
        }
    }
Пример #6
0
        protected override void AttachChildControls()
        {
            int num;
            int num2;
            int num3;

            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord       = this.Page.Request.QueryString["keyWord"];
            this.imgUrl        = (HiImage)this.FindControl("imgUrl");
            this.litContent    = (Literal)this.FindControl("litContent");
            this.litItemParams = (Literal)this.FindControl("litItemParams");
            this.rptProducts   = (VshopTemplatedRepeater)this.FindControl("rptCutDownProducts");
            this.txtTotal      = (HtmlInputHidden)this.FindControl("txtTotal");
            this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 0x3e8);
                this.rptCategories.DataSource = maxSubCategories;
                this.rptCategories.DataBind();
            }
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 10;
            }
            this.rptProducts.DataSource = ProductBrowser.GetCutDownProducts(new int?(this.categoryId), this.keyWord, num, num2, out num3, true);
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num3.ToString());
            PageTitle.AddSiteNameTitle("砍价列表页");

            #region 微信分享内容配置
            SiteSettings     masterSettings     = SettingsManager.GetMasterSettings(false);
            DistributorsInfo userIdDistributors = new DistributorsInfo();
            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
            }
            string str3 = "";
            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str4 = "";
            string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;
            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            string strDes = masterSettings.ShopHomeDescription;
            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.BrandShow)
            {
                strDes = "正品低价砍回家,澳洲尖货就在考拉萌购!";
            }

            this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + strDes + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|" + strDes + "|", HttpContext.Current.Request.Url });
            #endregion
        }
Пример #7
0
        private void Binding()
        {
            HtmlInputHidden htmlInputHidden = this.hidIsOpenCertification;
            int             num             = HiContext.Current.SiteSettings.IsOpenCertification ? 1 : 0;

            htmlInputHidden.Value = num.ToString();
            HtmlInputHidden htmlInputHidden2 = this.hidCertificationModel;

            num = HiContext.Current.SiteSettings.CertificationModel;
            htmlInputHidden2.Value = num.ToString();
            int.TryParse(this.Page.Request.QueryString["ShippingId"], out VSubmitIDInfo.shippingId);
            if (VSubmitIDInfo.shippingId > 0)
            {
                ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(VSubmitIDInfo.shippingId);
                if (shippingAddress != null)
                {
                    this.hidshippingId.Value = VSubmitIDInfo.shippingId.ToString();
                    this.lblShipTo.Text      = shippingAddress.ShipTo;
                    if (string.IsNullOrWhiteSpace(shippingAddress.IDNumber))
                    {
                        this.txtIDNumber.Text = string.Empty;
                    }
                    else
                    {
                        try
                        {
                            this.txtIDNumber.Text = HiCryptographer.Decrypt(shippingAddress.IDNumber);
                        }
                        catch
                        {
                            this.txtIDNumber.Text = shippingAddress.IDNumber;
                        }
                    }
                    if (HiContext.Current.SiteSettings.CertificationModel == 2)
                    {
                        this.fieldIDCardJust.Value = (string.IsNullOrWhiteSpace(shippingAddress.IDImage1) ? this.fieldIDCardJust.Value : shippingAddress.IDImage1);
                        this.fieldIDCardAnti.Value = (string.IsNullOrWhiteSpace(shippingAddress.IDImage2) ? this.fieldIDCardAnti.Value : shippingAddress.IDImage2);
                    }
                }
            }
            else if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["OrderId"]))
            {
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.Page.Request.QueryString["OrderId"]);
                if (orderInfo != null)
                {
                    this.hidorderId.Value = orderInfo.OrderId;
                    this.lblShipTo.Text   = orderInfo.ShipTo;
                    if (string.IsNullOrWhiteSpace(orderInfo.IDNumber))
                    {
                        this.txtIDNumber.Text = string.Empty;
                    }
                    else
                    {
                        try
                        {
                            this.txtIDNumber.Text = HiCryptographer.Decrypt(orderInfo.IDNumber);
                        }
                        catch
                        {
                            this.txtIDNumber.Text = orderInfo.IDNumber;
                        }
                    }
                    if (HiContext.Current.SiteSettings.CertificationModel == 2)
                    {
                        this.fieldIDCardJust.Value = (string.IsNullOrWhiteSpace(orderInfo.IDImage1) ? this.fieldIDCardJust.Value : orderInfo.IDImage1);
                        this.fieldIDCardAnti.Value = (string.IsNullOrWhiteSpace(orderInfo.IDImage2) ? this.fieldIDCardAnti.Value : orderInfo.IDImage2);
                    }
                }
            }
        }
Пример #8
0
        public void savepending(string _keyfield)
        {
            dynamicFramework    dyn = null;
            NameValueCollection Fields = new NameValueCollection();
            string fieldstr = "", keyfield = "", tempfieldstr = "T2.TEMPORARYID", tempkeyfield = "", fieldauto = "";
            bool   insertnew = _keyfield == null;

            for (int i = 0; i < dtparam.Rows.Count; i++)
            {
                string FieldNm   = dtparam.Rows[i]["FIELDNM"].ToString();
                string FieldDesc = dtparam.Rows[i]["FIELDDESC"].ToString();
                string FieldType = dtparam.Rows[i]["FIELDTYPE"].ToString();
                string FieldReff = dtparam.Rows[i]["FIELDREFF"].ToString();
                bool   FieldKey  = false;
                if (dtparam.Rows[i]["FIELDKEY"].ToString() != "")
                {
                    FieldKey = (bool)dtparam.Rows[i]["FIELDKEY"];
                }
                string FormulaType = dtparam.Rows[i]["FormulaType"].ToString();
                bool   isAuto = dtparam.Rows[i]["FIELDAUTO"].ToString().Trim() != "";
                string AutoPrefix = "", AutoSufix = "";
                if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.String" &&                //autoprefix and autosuffix must not be used to a non string fieldtype
                    isAuto == false && FieldReff == "")                                                     //and non-auto and non refferential field
                {
                    AutoPrefix = dtparam.Rows[i]["AUTOPREFIX"].ToString();
                    AutoSufix  = dtparam.Rows[i]["AUTOSUFIX"].ToString();
                }
                bool locked = false;
                if (dtparam.Rows[i]["LOCKED"].ToString() != "")
                {
                    locked = (bool)dtparam.Rows[i]["LOCKED"];
                }

                fieldstr     += ",[" + FieldNm + "]";
                tempfieldstr += ",(SELECT FIELDVALUE FROM PARAMETERSYSTEM_TEMPORARYDETAIL " +
                                "  WHERE FIELDNAME = '" + FieldNm + "' AND TEMPORARYID=T2.TEMPORARYID)[" + FieldNm + "] ";

                if (_keyfield == null)
                {
                    Control oCtrl = this.FindControl(FieldNm);
                    if (locked)
                    {
                        oCtrl = this.FindControl("l_" + FieldNm);          //overwrite values with original locked field value from the hidden "l_" prefix controls
                    }
                    if (FieldKey)
                    {
                        HtmlInputHidden hCtrl = (HtmlInputHidden)this.FindControl("h_" + FieldNm);
                        if (hCtrl.Value.Trim() != "")       //hidden control set during retrieve
                        {
                            //oCtrl = hCtrl;                  //always use key value from edited keys... oh well, maybe dont force edit if user want to change the key field value.. ease creation of large param with little differences on the param fields..
                            if (staticFramework.getvalue(oCtrl) == null || staticFramework.getvalue(oCtrl).ToString().Trim() == "")
                            {
                                oCtrl = hCtrl;                                                                            //in disabled mode, sometimes the control doesnt pass the value
                            }
                            if (staticFramework.getvalue(oCtrl).ToString() == staticFramework.getvalue(hCtrl).ToString()) //falsefy only if oCtrl value not changed.. meaning: dont do insertion cek..
                            {
                                insertnew = false;
                            }
                        }
                    }
                    Fields[FieldNm] = staticFramework.toSql(staticFramework.getvalue(oCtrl));
                    if (AutoPrefix.Length > 0 || AutoSufix.Length > 0)
                    {
                        Fields[FieldNm] = staticFramework.toSql(AutoPrefix + staticFramework.getvalue(oCtrl) + AutoSufix);
                    }
                    if (FieldType == "auto" && Fields[FieldNm].IndexOf(_autogen) >= 0)
                    {
                        string thisfieldauto = dtparam.Rows[i]["FIELDAUTO"].ToString();
                        if (thisfieldauto.StartsWith("q:") ||
                            thisfieldauto.StartsWith("s:") ||
                            thisfieldauto.StartsWith("f:"))
                        {
                            string thisautovalue = "", thisautotype = "";

                            if (thisfieldauto.StartsWith("q:"))
                            {
                                thisautovalue = "'" + Request.QueryString[thisfieldauto.Substring(2)] + "'";
                            }
                            else if (thisfieldauto.StartsWith("s:"))
                            {
                                thisautovalue = "'" + Session[thisfieldauto.Substring(2)].ToString() + "'";
                            }
                            else if (thisfieldauto.StartsWith("f:"))
                            {
                                thisautovalue = thisfieldauto.Substring(2);
                            }

                            if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.String")
                            {
                                thisautotype = "varchar(" + dtparamschema.Columns[FieldNm].MaxLength.ToString() + ")";
                            }
                            else if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Guid")
                            {
                                thisautotype = "uniqueidentifier";
                            }
                            else if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Boolean")
                            {
                                thisautotype = "bit";
                            }
                            else if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.DateTime")
                            {
                                thisautotype = "datetime";
                            }
                            else if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int16" ||
                                     dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int32" ||
                                     dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int64")
                            {
                                thisautotype = "int";
                            }
                            else if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Double" ||
                                     dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Decimal")
                            {
                                thisautotype = "float";
                            }

                            thisfieldauto = "DECLARE @" + FieldNm + " " + thisautotype + " SET @" + FieldNm + " = " + thisautovalue;
                        }

                        Fields[FieldNm] = "@" + FieldNm;
                        fieldauto      += thisfieldauto + Environment.NewLine;
                    }
                    if (FieldReff.IndexOf(":[") > 0 && FieldReff.Trim().ToLower().IndexOf("select") == 0)
                    {   //special check for cascading refferencial FieldType
                        string qry = FieldReff.Trim();
                        qry = qry.Substring(qry.IndexOf(" ") + 1).Trim();
                        string fldkey = qry.Substring(0, qry.IndexOf(",")).Trim();
                        qry = qry.Substring(qry.IndexOf(",") + 1).Trim();
                        int cekpos = qry.IndexOf(",");
                        if (cekpos == -1 || cekpos > qry.IndexOf(" "))
                        {
                            cekpos = qry.IndexOf(" ");
                        }
                        string flddesc = qry.Substring(0, cekpos).Trim();
                        qry = qry.Substring(qry.ToLower().IndexOf("from") + 5).Trim();
                        string tblname = qry.Substring(0, qry.ToLower().IndexOf("where")).Trim();
                        qry = "select " + fldkey + " from " + tblname + " where " + fldkey + " = " + Fields[FieldNm];
                        object[] cekpar = new object[] { Fields[FieldNm] };
                        conn.ExecReader(qry, cekpar, dbtimeout);                //cek if Fields[FieldNm] contains correct key field
                        if (!conn.hasRow())
                        {                                                       //if not, cek if Fields[FieldNm] contains desc field
                            qry = "select " + fldkey + " from " + tblname + " where " + flddesc + " = " + Fields[FieldNm];
                            conn.ExecReader(qry, cekpar, dbtimeout);
                            if (conn.hasRow())
                            {                                                   //if so, renew Fields[FieldNm] to have value from key field
                                Fields[FieldNm] = staticFramework.toSql(conn.GetNativeFieldValue(fldkey));
                            }
                        }
                    }
                    /* */
                    if (staticFramework.getvalue(oCtrl) != null && staticFramework.getvalue(oCtrl).ToString() != "")
                    {
                        switch (FormulaType)
                        {
                        case "1":
                            if (dyn == null)
                            {
                                dyn = new dynamicFramework(conn);
                            }
                            try
                            {
                                string fieldvalue   = staticFramework.getvalue(oCtrl).ToString();
                                string formula      = dyn.retrvCondFW(fieldvalue);
                                string formulaquery = dyn.Retrieve(formula, "").ToLower().Replace("select ", "select top 0 ");
                                conn.ExecNonQuery(formulaquery, null, dbtimeout);
                            }
                            catch (Exception exd)
                            {
                                string errmsg = exd.Message;
                                if (errmsg.IndexOf("Last Query") > 0)
                                {
                                    errmsg = errmsg.Substring(0, errmsg.IndexOf("Last Query"));
                                }
                                string msg = "Invalid formula in " + FieldDesc + "\nErrMsg: " + errmsg;
                                throw new Exception(msg);
                            }
                            break;

                        case "2":
                            if (dyn == null)
                            {
                                dyn = new dynamicFramework(conn);
                            }
                            try
                            {
                                string[] strsep      = new string[] { "&&", "||" };
                                string[] fieldvalues = staticFramework.getvalue(oCtrl).ToString().Split(strsep, StringSplitOptions.RemoveEmptyEntries);
                                foreach (string fieldvalue in fieldvalues)
                                {
                                    string formulacond  = " and " + dyn.retrvCondFW(fieldvalue);
                                    string formulaquery = dyn.Retrieve("1", formulacond).ToLower().Replace("select ", "select top 0 ").Replace("@value", "null");
                                    conn.ExecNonQuery(formulaquery, null, dbtimeout);
                                }
                            }
                            catch (Exception exd)
                            {
                                string errmsg = exd.Message;
                                if (errmsg.IndexOf("Last Query") > 0)
                                {
                                    errmsg = errmsg.Substring(0, errmsg.IndexOf("Last Query"));
                                }
                                string msg = "Invalid formula in " + FieldDesc + "\nErrMsg: " + errmsg;
                                throw new Exception(msg);
                            }
                            break;

                        case "3":
                            if (dyn == null)
                            {
                                dyn = new dynamicFramework(conn);
                            }
                            try
                            {
                                string fieldvalue   = staticFramework.getvalue(oCtrl).ToString();
                                string formulacond  = " and " + dyn.retrvCondFW(fieldvalue);
                                string formulaquery = dyn.Retrieve("1", formulacond).ToLower().Replace("select ", "select top 0 ");
                                conn.ExecNonQuery(formulaquery, null, dbtimeout);
                            }
                            catch (Exception exd)
                            {
                                string errmsg = exd.Message;
                                if (errmsg.IndexOf("Last Query") > 0)
                                {
                                    errmsg = errmsg.Substring(0, errmsg.IndexOf("Last Query"));
                                }
                                string msg = "Invalid formula in " + FieldDesc + "\nErrMsg: " + errmsg;
                                throw new Exception(msg);
                            }
                            break;

                        default:
                            break;
                        }
                    }
                    /* */

                    if (FieldKey)
                    {
                        keyfield     += " AND [" + FieldNm + "]=" + Fields[FieldNm];
                        tempkeyfield += " AND [" + FieldNm + "]=" + Fields[FieldNm];
                        tempkeyfield += " AND [" + FieldNm + "]<>" + staticFramework.toSql(_autogen);
                    }
                }
            }
            fieldstr = fieldstr.Substring(1);

            if (_keyfield != null)
            {
                keyfield     = _keyfield;
                tempkeyfield = _keyfield;
            }

            string tempparamsql =
                fieldauto +
                "SELECT " +
                "(SELECT TOP 1 TEMPORARYID FROM " +
                "	(SELECT "+ tempfieldstr + " FROM PARAMETERSYSTEM_TEMPORARY T1 " +
                "	JOIN PARAMETERSYSTEM_TEMPORARYDETAIL T2 ON T2.TEMPORARYID=T1.TEMPORARYID "+
                "	GROUP BY T2.TEMPORARYID "+
                "	)X WHERE 1=1 "+ keyfield +
                ") as col0, NEWID() as col1 ";

            conn.ExecReader(tempparamsql, null, dbtimeout);
            conn.hasRow();

            string TemporarID = conn.GetFieldValue(0);

            if (TemporarID == "")
            {
                TemporarID = conn.GetFieldValue(1);
            }
            else
            if (insertnew)
            {
                throw new Exception("Parameter with that key value had already been in the Pending Approval!");
            }

            string    SavingType = "Insert";
            DataTable dt         = conn.GetDataTable(
                fieldauto +
                " SELECT " + fieldstr + " FROM " + TableNm +
                " WHERE 1=1 " + keyfield
                , null, dbtimeout);

            if (dt.Rows.Count > 0)
            {
                SavingType = "Update";
                if (insertnew)
                {
                    throw new Exception("Parameter with that key value already exists!");
                }
            }

            if (_keyfield != null)
            {
                SavingType = "Delete";
            }

            conn.ExecuteNonQuery(
                "DELETE PARAMETERSYSTEM_TEMPORARY WHERE TEMPORARYID=@1"
                , new object[] { TemporarID }, dbtimeout);
            conn.ExecuteNonQuery(
                "INSERT INTO PARAMETERSYSTEM_TEMPORARY " +
                "(TemporaryID,TableName,Status,CreatedBy) VALUES " +
                "(@1,@2,@3,@4)"
                , new object[] { TemporarID, TableNm, SavingType, Session["UserID"] }, dbtimeout);

            for (int col = 0; col < dt.Columns.Count; col++)
            {
                string valuebefore = staticFramework.toSql(null), value = staticFramework.toSql(null);
                if (dt.Rows.Count > 0)
                {
                    valuebefore = staticFramework.toSql(dt.Rows[0][col]);
                }
                if (Fields.Count > col)
                {
                    value = Fields[col];
                }
                else
                {
                    value = valuebefore;
                }

                conn.ExecuteNonQuery(
                    fieldauto +
                    "INSERT INTO PARAMETERSYSTEM_TEMPORARYDETAIL " +
                    "(TemporaryID,FieldName,FieldValue,FieldValueBefore) VALUES " +
                    "(" + staticFramework.toSql(TemporarID) + "," +
                    staticFramework.toSql(dt.Columns[col].ColumnName) + "," +
                    "CONVERT(VARCHAR(8000)," + value + ")," +
                    "CONVERT(VARCHAR(8000)," + valuebefore + ")" +
                    ")"
                    , null, dbtimeout);
            }
        }
        private void BindReturnsTable(int returnsId)
        {
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnsId);
            int        num;
            DateTime   dateTime;
            DateTime   value;
            DateTime   dateTime2;
            string     text;

            if (returnInfo != null)
            {
                if (returnInfo.HandleStatus == ReturnStatus.Refused && (this.order.OrderStatus == OrderStatus.SellerAlreadySent || (this.order.OrderStatus == OrderStatus.Finished && !this.order.IsServiceOver)))
                {
                    this.lnkReApply.Visible = true;
                    this.lnkReApply.HRef    = "AfterSalesApply?OrderId=" + returnInfo.OrderId + "&SkuId=" + returnInfo.SkuId;
                }
                if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed || returnInfo.HandleStatus == ReturnStatus.Deliverying)
                {
                    this.lnkToSendGoods.Visible = true;
                    AttributeCollection attributes = this.lnkToSendGoods.Attributes;
                    num = returnInfo.ReturnId;
                    attributes.Add("ReturnId", num.ToString());
                    if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                    {
                        this.lnkToSendGoods.InnerText = "修改发货信息";
                    }
                    else
                    {
                        this.lnkToSendGoods.InnerText = "发货";
                    }
                }
                HtmlInputHidden htmlInputHidden = this.txtAfterSaleType;
                num = (int)returnInfo.AfterSaleType;
                htmlInputHidden.Value = num.ToString();
                text     = "";
                dateTime = (returnInfo.AgreedOrRefusedTime.HasValue ? returnInfo.AgreedOrRefusedTime.Value : this.returns.ApplyForTime);
                if (returnInfo.FinishTime.HasValue)
                {
                    DateTime?finishTime = returnInfo.FinishTime;
                    value = DateTime.MinValue;
                    if (!(finishTime == (DateTime?)value))
                    {
                        dateTime2 = returnInfo.FinishTime.Value;
                        goto IL_01c9;
                    }
                }
                dateTime2 = this.returns.ApplyForTime;
                goto IL_01c9;
            }
            return;

IL_01c9:
            DateTime dateTime3 = dateTime2;
            DateTime dateTime4 = returnInfo.UserSendGoodsTime.HasValue ? returnInfo.UserSendGoodsTime.Value : dateTime;
            DateTime dateTime5 = returnInfo.ConfirmGoodsTime.HasValue ? returnInfo.ConfirmGoodsTime.Value : dateTime4;
            Literal  literal   = this.litReturnAmount;

            num                      = returnInfo.Quantity;
            literal.Text             = num.ToString();
            this.litRefundTotal.Text = this.returns.RefundAmount.F2ToString("f2");
            if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                this.stepTemplate = "<span>买家申请退款</span><span>商家同意申请</span><span>退款完成</span>";
                if (returnInfo.HandleStatus == ReturnStatus.Applied)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                    string format = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format, arg, value.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                    string format2 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg2 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format2, arg2, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Returned)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                    string format3 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg3 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format3, arg3, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Refused)
                {
                    this.txtIsRefused.Value = "1";
                    this.stepTemplate       = "<span>买家申请退款</span><span>商家拒绝申请</span><span>退款失败</span>";
                    this.processTemplate    = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                    string format4 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg4 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format4, arg4, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
                }
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Applied)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format5 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg5 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format5, arg5, value.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format6 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg6 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format6, arg6, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format7 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg7 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format7, arg7, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.GetGoods)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string str     = text;
                string format8 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg8 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = str + string.Format(format8, arg8, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd"), dateTime5.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Returned)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                string str2    = text;
                string format9 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg9 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = str2 + string.Format(format9, arg9, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd"), dateTime5.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Refused)
            {
                this.txtIsRefused.Value = "1";
                this.stepTemplate       = "<span>买家申请退货</span><span>商家拒绝申请</span><span>退货失败</span>";
                this.processTemplate    = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
            }
            this.litStep.Text       = this.stepTemplate;
            this.litTime.Text       = text;
            this.litProcess.Text    = this.processTemplate;
            this.litUserRemark.Text = returnInfo.UserRemark;
            string userCredentials = returnInfo.UserCredentials;

            if (string.IsNullOrEmpty(userCredentials))
            {
                this.divCredentials.Visible = false;
            }
            else
            {
                string[] array = userCredentials.Split('|');
                userCredentials = "";
                string[] array2 = array;
                foreach (string str3 in array2)
                {
                    userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str3);
                }
                this.litCredentialsImg.Text = userCredentials;
            }
            if (!string.IsNullOrEmpty(returnInfo.AdminRemark))
            {
                this.litAdminRemark.Text = returnInfo.AdminRemark;
                if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = true;
                }
            }
            else if (this.AdminRemarkRow != null)
            {
                this.AdminRemarkRow.Visible = false;
            }
            this.litAdminRemark.Text = returnInfo.AdminRemark;
            this.litRemark.Text      = returnInfo.ReturnReason;
            this.litType.Text        = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
            this.orderId             = returnInfo.OrderId;
            if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed || returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.btnSendGoodsReturns.Visible = true;
            }
            if (returnInfo.RefundType == RefundTypes.InBankCard)
            {
                this.bankRow1.Visible        = true;
                this.bankRow2.Visible        = true;
                this.bankRow3.Visible        = true;
                this.litBankName.Text        = returnInfo.BankName;
                this.litBankAccountName.Text = returnInfo.BankAccountName;
                this.litBankAccountNo.Text   = returnInfo.BankAccountNo;
            }
            if (this.returns.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (this.returns.HandleStatus == ReturnStatus.Deliverying || this.returns.HandleStatus == ReturnStatus.GetGoods || this.returns.HandleStatus == ReturnStatus.Returned))
            {
                this.btnViewLogistic.Visible = true;
                AttributeCollection attributes2 = this.btnViewLogistic.Attributes;
                num = this.returns.ReturnId;
                attributes2.Add("returnsid", num.ToString());
            }
        }
 protected override void AttachChildControls()
 {
     this.btnSendGoodsReturns        = ButtonManager.Create(this.FindControl("btnSendGoodsReturns"));
     this.divCredentials             = (HtmlGenericControl)this.FindControl("divCredentials");
     this.returnsId                  = base.GetParameter("ReturnsId", false).ToInt(0);
     this.products                   = (Common_OrderItems_AfterSales)this.FindControl("Common_OrderItems_AfterSales");
     this.txtOrderId                 = (Literal)this.FindControl("txtOrderId");
     this.litRemark                  = (Literal)this.FindControl("litRemark");
     this.litAdminRemark             = (Literal)this.FindControl("litAdminRemark");
     this.litType                    = (Literal)this.FindControl("litType");
     this.litTotalPrice              = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     this.litRefundTotal             = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
     this.litOrderTotal              = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
     this.expresslist1               = (ExpressDropDownList)this.FindControl("expressDropDownList");
     this.hidExpressCompanyName      = (HiddenField)this.FindControl("hidExpressCompanyName");
     this.hidShipOrderNumber         = (HiddenField)this.FindControl("hidShipOrderNumber");
     this.txtAfterSaleType           = (HtmlInputHidden)this.FindControl("txtAfterSaleType");
     this.litStep                    = (Literal)this.FindControl("litStep");
     this.litTime                    = (Literal)this.FindControl("litTime");
     this.litProcess                 = (Literal)this.FindControl("litProcess");
     this.litUserRemark              = (Literal)this.FindControl("litUserRemark");
     this.litCredentialsImg          = (Literal)this.FindControl("litCredentialsImg");
     this.txtAfterSaleId             = (Literal)this.FindControl("txtAfterSaleId");
     this.txtIsRefused               = (HtmlInputHidden)this.FindControl("txtIsRefused");
     this.lnkToSendGoods             = (HtmlAnchor)this.FindControl("lnkToSendGoods");
     this.lnkReApply                 = (HtmlAnchor)this.FindControl("lnkReApply");
     this.litReturnAmount            = (Literal)this.FindControl("litReturnAmount");
     this.litBankName                = (Literal)this.FindControl("litBankName");
     this.litBankAccountName         = (Literal)this.FindControl("litBankAccountName");
     this.litBankAccountNo           = (Literal)this.FindControl("litBankAccountNo");
     this.bankRow1                   = (HtmlGenericControl)this.FindControl("bankRow1");
     this.bankRow2                   = (HtmlGenericControl)this.FindControl("bankRow2");
     this.bankRow3                   = (HtmlGenericControl)this.FindControl("bankRow3");
     this.AdminRemarkRow             = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
     this.btnViewLogistic            = (HtmlAnchor)this.FindControl("btnViewLogistic");
     this.btnSendGoodsReturns.Click += this.btnSendGoodsReturns_Click;
     this.returns                    = TradeHelper.GetReturnInfo(this.returnsId);
     this.txtAfterSaleId.Text        = this.returnsId.ToString();
     if (this.returns == null)
     {
         this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("退货信息不存在或者不属于当前用户"));
     }
     else
     {
         this.order = TradeHelper.GetOrderInfo(this.returns.OrderId);
         if (this.order == null || this.order.UserId != HiContext.Current.UserId)
         {
             this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
         }
         else if (!this.Page.IsPostBack)
         {
             if (this.expresslist1 != null)
             {
                 this.expresslist1.ShowAllExpress = true;
                 this.expresslist1.DataBind();
             }
             this.BindReturnsTable(this.returnsId);
             this.BindOrderItems(this.order);
             this.BindProducts(this.order, this.returns.SkuId);
         }
     }
 }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            clsCache.NoCache();
            btnSimpleSearch.Attributes.Add("onclick", "return ChkValidation();");
            // Ajax.Utility.RegisterTypeForAjax(typeof(Eligibility.AjaxMethods), this.Page);
            Ajax.Utility.RegisterTypeForAjax(typeof(Student.clsStudent), this.Page);
            //   Ajax.Utility.RegisterTypeForAjax(typeof(Student.clsStudent));

            ContentPlaceHolder Cntph = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");

            StudentAdvancedSearchCtrl = (Eligibility.WebCtrl.StudentAdvancedSearchforManualProcess)Cntph.FindControl("StudentAdvancedSearchForManualProcess1");

            //StudentAdvancedSearchCtrl = (Eligibility.WebCtrl.StudentAdvancedSearchforManualProcess)Page.FindControl("StudentAdvancedSearchForManualProcess1");
            hid_fk_AcademicYr_ID.Value = StudentAdvancedSearchCtrl.ddlAcademicYear.SelectedValue.ToString();
            hidAcademicYrText.Value    = StudentAdvancedSearchCtrl.ddlAcademicYear.SelectedItem.ToString();

            if (!IsPostBack)
            {
                ContentPlaceHolder Cntph1 = (ContentPlaceHolder)Page.PreviousPage.Master.FindControl("ContentPlaceHolder1");
                //ElgConfirm_Inst_Student_Search ob = (ElgConfirm_Inst_Student_Search)Context.Handler;
                searchInstNew temp = (searchInstNew)Cntph1.FindControl("SchInst1");
                hidInstID.Value = ((HtmlInputHidden)Cntph1.FindControl("hidInstID")).Value;
                hidUniID.Value  = Classes.clsGetSettings.UniversityID.ToString();

                HtmlInputHidden[] hid = new HtmlInputHidden[29];
                hid[0]  = hidInstID;
                hid[1]  = hidUniID;
                hid[2]  = hidElgFormNo;
                hid[3]  = hidpkStudentID;
                hid[4]  = hidpkYear;
                hid[5]  = hidpkFacID;
                hid[6]  = hidpkCrID;
                hid[7]  = hidpkMoLrnID;
                hid[8]  = hidpkPtrnID;
                hid[9]  = hidpkBrnID;
                hid[10] = hidpkCrPrDetailsID;
                hid[11] = hidElgStatusColl;
                hid[12] = hidCollElgFlag;
                hid[13] = hidCollElgFlagReason;
                hid[14] = hidInv;
                hid[15] = hidIsBlank;
                hid[16] = hidrbFilterYesNo;
                hid[17] = hid_fk_AcademicYr_ID;
                hid[18] = hidAcademicYr;
                hid[19] = hidAcademicYrText;
                hid[20] = hidStateID;
                hid[21] = hidBodyID;
                hid[22] = hidBodySelText;
                hid[23] = hidDOB;
                hid[24] = hidLastName;
                hid[25] = hidFirstName;
                hid[26] = hidGender;
                hid[27] = hidrbWithInv;
                hid[28] = hidrbWithoutInv;

                Common.setHiddenVariables(ref hid);
            }

            if (hidInstID.Value != "" && hidInstID.Value != null)
            {
                lblPageHead.Text  = "Manual Process Eligibility";
                lblSubHeader.Text = "  for " + InstRep.InstituteName(hidUniID.Value, hidInstID.Value);
            }

            StudentAdvancedSearchCtrl.QstrNavigate = null;

            StudentAdvancedSearchCtrl.StrUrl   = "ELGV2_ManualProcess__2.aspx?Search=" + "Adv";
            StudentAdvancedSearchCtrl.GridType = "IA";


            if (Request.QueryString["Search"] == "Adv")
            {
                if (Request.QueryString["Navigate"] == "back")
                {
                    StudentAdvancedSearchCtrl.QstrNavigate = "back";
                    //StudentAdvancedSearchCtrl.StrUrl = "ELGV2_ManualProcess__2.aspx?Search=" + "Adv" + "&Inv=" + hidInv.Value.ToString() + "&CollElg=" + hidElgStatusColl.Value.ToString() + "&FilterYesNoExBody=" + hidrbFilterYesNo.Value.ToString() + "&AcYear=" + hid_fk_AcademicYr_ID.Value.ToString() + "&AcYearText=" + hidAcademicYrText.Value.ToString() + "&StateID=" + hidStateID.Value.ToString() + "BodyID=" + hidBodyID.Value.ToString() + "BodyText=" + hidBodySelText.Value.ToString() + "InstituteID=" + hidInstID.Value.ToString() + "Faculty=" + hidpkFacID.Value.ToString() + "Course=" + hidpkCrID.Value.ToString() + "MoLearning=" + hidpkMoLrnID.Value.ToString() + "Pattern=" + hidpkPtrnID.Value.ToString() + "Branch=" + hidpkBrnID.Value.ToString() + "CoursePrtDetails=" + hidpkCrPrDetailsID.Value.ToString() + "ElgFormNo=" + hidElgFormNo.Value.ToString();

                    //StudentAdvancedSearchCtrl.GridType = "IA";
                    divAdvSearch.Style.Remove("display");
                    divAdvSearch.Style.Add("display", "block");
                    divSimpleSearch.Style.Remove("display");
                    divSimpleSearch.Style.Add("display", "none");
                    StudentAdvancedSearchCtrl.Div1.Style.Add("display", "block");

                    if (Request.QueryString["AcYear"] != "0")
                    {
                        lblAcademicYear.Text = " [Academic Year " + Request.QueryString["AcYearText"].ToString() + "]";
                        //lblAcademicYear.Text = " for Academic Year " + hidAcademicYrText.Value;
                        lblAcademicYear.Attributes.Add("style", "display:inline");
                    }
                    else if (Request.QueryString["AcYear"] == "0")
                    {
                        lblAcademicYear.Attributes.Add("style", "display:none");
                    }
                }
                else
                {
                    StudentAdvancedSearchCtrl.QstrNavigate = null;
                    StudentAdvancedSearchCtrl.StrUrl       = "ELGV2_ManualProcess__2.aspx?Search=" + "Adv";
                }
            }
            else if (Request.QueryString["Search"] == "Simple")
            {
                divAdvSearch.Style.Remove("display");
                divSimpleSearch.Style.Remove("display");
                divSimpleSearch.Style.Add("display", "block");
                divAdvSearch.Style.Add("display", "none");
            }

            if (hidSearchType.Value == "Simple")
            {
                divAdvSearch.Style.Remove("display");
                divSimpleSearch.Style.Remove("display");
                divSimpleSearch.Style.Add("display", "block");
                divAdvSearch.Style.Add("display", "none");
                StudentAdvancedSearchCtrl.DivFilterExamBody.Style.Add("display", "none");
                StudentAdvancedSearchCtrl.Div1.Style.Add("display", "none");
            }
            else if (hidSearchType.Value == "Adv")
            {
                divAdvSearch.Style.Remove("display");
                divSimpleSearch.Style.Remove("display");
                divAdvSearch.Style.Add("display", "block");
                divSimpleSearch.Style.Add("display", "none");
                StudentAdvancedSearchCtrl.DivFilterExamBody.Style.Add("display", "none");
                StudentAdvancedSearchCtrl.Div1.Style.Add("display", "none");



                //if (hid_fk_AcademicYr_ID.Value.ToString() != "0" || hid_fk_AcademicYr_ID.Value != "" || hid_fk_AcademicYr_ID.Value != null)
                if (hidAcademicYrText.Value != "--- Select ---")

                {
                    lblAcademicYear.Text = " [Academic Year " + hidAcademicYrText.Value + "]";
                    lblAcademicYear.Attributes.Add("style", "display:inline");
                }
                else if (hidAcademicYrText.Value == "--- Select ---")
                {
                    lblAcademicYear.Attributes.Add("style", "display:none");
                    StudentAdvancedSearchCtrl.DivFilterExamBody.Style.Add("display", "none");
                    StudentAdvancedSearchCtrl.Div1.Style.Add("display", "none");
                }
            }
        }
Пример #12
0
        protected override void AttachChildControls()
        {
            this.shipTo                  = (HtmlInputText)this.FindControl("shipTo");
            this.cellphone               = (HtmlInputText)this.FindControl("cellphone");
            this.Hiddenshipid            = (HtmlInputHidden)this.FindControl("shipId");
            this.WapLocateAddress        = (Common_WAPLocateAddress)this.FindControl(Common_WAPLocateAddress.TagId);
            this.WAPLocateAddressUpgrade = (Common_WAPLocateAddressUpgrade)this.FindControl(Common_WAPLocateAddressUpgrade.TagId);
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.chkIsDefault           = (HtmlInputCheckBox)this.FindControl("chkIsDefault");
            this.hidIsOpenCertification = (HtmlInputHidden)this.FindControl("hidIsOpenCertification");
            ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(this.shippingid);
            string fullRegion = RegionHelper.GetFullRegion(shippingAddress.RegionId, " ", true, 0);

            if (masterSettings.OpenMultStore)
            {
                this.WapLocateAddress.Visible        = false;
                this.WAPLocateAddressUpgrade.Visible = true;
                if (this.WAPLocateAddressUpgrade != null)
                {
                    this.WAPLocateAddressUpgrade.RegionId       = shippingAddress.RegionId;
                    this.WAPLocateAddressUpgrade.Address        = shippingAddress.RegionLocation + shippingAddress.Address;
                    this.WAPLocateAddressUpgrade.RegionLocation = fullRegion;
                    this.WAPLocateAddressUpgrade.BuildingNumber = shippingAddress.BuildingNumber;
                    this.WAPLocateAddressUpgrade.LatLng         = shippingAddress.LatLng;
                }
            }
            else
            {
                this.WapLocateAddress.Visible        = true;
                this.WAPLocateAddressUpgrade.Visible = false;
                if (this.WapLocateAddress != null)
                {
                    this.WapLocateAddress.RegionId       = shippingAddress.RegionId;
                    this.WapLocateAddress.Address        = shippingAddress.Address;
                    this.WapLocateAddress.BuildingNumber = shippingAddress.BuildingNumber;
                }
            }
            if (this.shipTo != null)
            {
                this.shipTo.Value = shippingAddress.ShipTo;
            }
            if (this.cellphone != null)
            {
                this.cellphone.Value = shippingAddress.CellPhone;
            }
            if (this.Hiddenshipid != null)
            {
                this.Hiddenshipid.Value = this.shippingid.ToString();
            }
            this.chkIsDefault.Checked = shippingAddress.IsDefault;
            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["shipTo"]))
            {
                this.shipTo.Value = HttpUtility.UrlDecode(this.Page.Request.QueryString["shipTo"]);
            }
            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["cellphone"]))
            {
                this.cellphone.Value = HttpUtility.UrlDecode(this.Page.Request.QueryString["cellphone"]);
            }
            this.hidIsOpenCertification.Value = (masterSettings.IsOpenCertification ? "下一步" : "保存收货地址");
            PageTitle.AddSiteNameTitle("编辑收货地址");
        }
Пример #13
0
        protected string createcontrol()
        {
            TableRow  TableFilterRow;
            TableCell TableFilterDesc, TableFilterControl, TableFilterSeprtr;
            string    clearjs = "";

            for (int i = 0; i < dtparam.Rows.Count; i++)
            {
                string FieldNm   = dtparam.Rows[i]["FIELDNM"].ToString();
                string FieldDesc = dtparam.Rows[i]["FIELDDESC"].ToString();
                string FieldType = dtparam.Rows[i]["FIELDTYPE"].ToString();
                bool   FieldKey  = false;
                if (dtparam.Rows[i]["FIELDKEY"].ToString() != "")
                {
                    FieldKey = (bool)dtparam.Rows[i]["FIELDKEY"];
                }
                bool FieldMand = false;
                if (dtparam.Rows[i]["FIELDMAN"].ToString() != "")
                {
                    FieldMand = (bool)dtparam.Rows[i]["FIELDMAN"];
                }
                bool   isAuto    = dtparam.Rows[i]["FIELDAUTO"].ToString().Trim() != "";
                string FieldAuto = dtparam.Rows[i]["FIELDAUTO"].ToString().Trim();
                bool   locked    = false;
                if (dtparam.Rows[i]["LOCKED"].ToString() != "")
                {
                    locked = (bool)dtparam.Rows[i]["LOCKED"];
                }
                locked = locked || isAuto;

                TableFilterRow = new TableRow();
                TableInput.Rows.Add(TableFilterRow);
                if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Guid" || isAuto)
                {
                    TableFilterRow.Style["display"] = "none";
                }
                TableFilterDesc    = new TableCell();
                TableFilterSeprtr  = new TableCell();
                TableFilterControl = new TableCell();
                TableFilterRow.Cells.Add(TableFilterDesc);
                TableFilterRow.Cells.Add(TableFilterSeprtr);
                TableFilterRow.Cells.Add(TableFilterControl);

                if (!IsPostBack && !Page.IsCallback)
                {
                    TableFilterDesc.Text     = FieldDesc;
                    TableFilterDesc.CssClass = "B01";

                    TableFilterSeprtr.Text     = ":";
                    TableFilterSeprtr.CssClass = "BS";

                    TableFilterControl.CssClass = "B11";
                }
                WebControl oCtrl;
                string     devexpresseditorlib = this.Page.MapPath("~/bin") + "\\DevExpress.Web.v17.1.dll";
                string     dmscontrollib       = this.Page.MapPath("~/bin") + "\\DMSControls.dll";
                if (FieldType == "")
                {
                    if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Boolean")
                    {
                        FieldType = "chk";
                    }
                    if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.DateTime")
                    {
                        FieldType = "date";
                    }
                    if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int16" ||
                        dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int32" ||
                        dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Int64")
                    {
                        FieldType = "int";
                    }
                    if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Double" ||
                        dtparamschema.Columns[FieldNm].DataType.ToString() == "System.Decimal")
                    {
                        FieldType = "float";
                    }
                }
                string initvalue = "";
                if (FieldAuto.StartsWith("q:"))
                {
                    initvalue = Request.QueryString[FieldAuto.Substring(2)];
                }
                else if (FieldAuto.StartsWith("s:"))
                {
                    initvalue = Session[FieldAuto.Substring(2)].ToString();
                }
                switch (FieldType.ToLower())
                {
                case "auto":
                    oCtrl    = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, "System.Web.UI.WebControls", "System.Web.UI.WebControls.TextBox");
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').value = '" + _autogen + "';";
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').disabled = false;";
                    break;

                case "float":
                    oCtrl    = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, dmscontrollib, "DMSControls.TXT_CURRENCY");
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').value = '" + initvalue + "';";
                    break;

                case "int":
                    oCtrl    = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, dmscontrollib, "DMSControls.TXT_NUMBER");
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').value = '" + initvalue + "';";
                    break;

                case "date":
                    oCtrl = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, devexpresseditorlib, "DevExpress.Web.ASPxDateEdit");
                    (oCtrl as DevExpress.Web.ASPxDateEdit).ClientInstanceName = oCtrl.ClientID;
                    clearjs += oCtrl.ClientID + ".SetDate(null);";
                    break;

                case "chk":
                    oCtrl = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, "System.Web.UI.WebControls", "System.Web.UI.WebControls.CheckBox");
                    if (FieldNm == "ACTIVE")
                    {
                        clearjs += "document.getElementById('" + oCtrl.ClientID + "').checked = true;";
                    }
                    else
                    {
                        clearjs += "document.getElementById('" + oCtrl.ClientID + "').checked = false;";
                    }
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').disabled = false;";
                    break;

                case "ddl":
                    oCtrl = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, devexpresseditorlib, "DevExpress.Web.ASPxComboBox");
                    (oCtrl as DevExpress.Web.ASPxComboBox).ClientInstanceName         = oCtrl.ClientID;
                    (oCtrl as DevExpress.Web.ASPxComboBox).Callback                  += new DevExpress.Web.CallbackEventHandlerBase(dxComboBox_Callback);
                    (oCtrl as DevExpress.Web.ASPxComboBox).EnableIncrementalFiltering = true;
                    (oCtrl as DevExpress.Web.ASPxComboBox).CallbackPageSize           = 20;
                    (oCtrl as DevExpress.Web.ASPxComboBox).EnableCallbackMode         = true;
                    clearjs += oCtrl.ClientID + ".SetValue(null);";
                    clearjs += oCtrl.ClientID + ".PerformCallback('r');";
                    break;

                default:
                    oCtrl    = (WebControl)Reflection.CreateControl(TableFilterControl, FieldNm, "System.Web.UI.WebControls", "System.Web.UI.WebControls.TextBox");
                    clearjs += "document.getElementById('" + oCtrl.ClientID + "').value = '" + initvalue + "';";
                    break;
                }

                if (initvalue != "")
                {
                    staticFramework.retrieve(initvalue, oCtrl);
                }

                if ((FieldKey || FieldMand) && FieldType != "a")
                {
                    oCtrl.CssClass = "mandatory";
                }

                if (FieldKey)
                {
                    HtmlInputHidden hCtrl = (HtmlInputHidden)Reflection.CreateControl(TableFilterControl, "h_" + FieldNm, "System.Web.UI.WebControls", "System.Web.UI.HtmlControls.HtmlInputHidden");
                    clearjs += "document.getElementById('" + hCtrl.ClientID + "').value = '" + initvalue + "';";
                }

                if (locked)
                {
                    oCtrl.Enabled = false;
                    HtmlInputHidden lCtrl = (HtmlInputHidden)Reflection.CreateControl(TableFilterControl, "l_" + FieldNm, "System.Web.UI.WebControls", "System.Web.UI.HtmlControls.HtmlInputHidden");
                }
            }
            return(clearjs);
        }
Пример #14
0
        public void retrievepending(string TemporaryID)
        {
            DataTable dtretrieve = conn.GetDataTable(
                sqlpending1 + " AND Y.TEMPORARYID=@1"
                , new object[] { TemporaryID }, dbtimeout);

            for (int i = 0; i < dtparam.Rows.Count; i++)
            {
                string FieldNm   = dtparam.Rows[i]["FIELDNM"].ToString();
                string FieldReff = dtparam.Rows[i]["FIELDREFF"].ToString();
                bool   FieldKey  = false;
                if (dtparam.Rows[i]["FIELDKEY"].ToString() != "")
                {
                    FieldKey = (bool)dtparam.Rows[i]["FIELDKEY"];
                }
                bool   isAuto = dtparam.Rows[i]["FIELDAUTO"].ToString().Trim() != "";
                string AutoPrefix = "", AutoSufix = "";
                if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.String" &&                //autoprefix and autosuffix must not be used to a non string fieldtype
                    isAuto == false && FieldReff == "")                                                     //and non-auto and non refferential field
                {
                    AutoPrefix = dtparam.Rows[i]["AUTOPREFIX"].ToString();
                    AutoSufix  = dtparam.Rows[i]["AUTOSUFIX"].ToString();
                }
                bool locked = false;
                if (dtparam.Rows[i]["LOCKED"].ToString() != "")
                {
                    locked = (bool)dtparam.Rows[i]["LOCKED"];
                }

                WebControl oCtrl = (WebControl)TableInput.FindControl(FieldNm);
                if (oCtrl is ASPxComboBox)
                {
                    reffcascade((ASPxComboBox)oCtrl, FieldReff);
                }
                if (AutoPrefix.Length > 0 || AutoSufix.Length > 0)
                {
                    string value = null;
                    if (dtretrieve.Rows.Count > 0)
                    {
                        value = dtretrieve.Rows[0][FieldNm].ToString();
                    }
                    if (value.Length > AutoPrefix.Length + AutoSufix.Length)
                    {
                        value = value.Substring(AutoPrefix.Length, value.Length - AutoSufix.Length - AutoPrefix.Length);
                    }
                    staticFramework.retrieve(value, oCtrl);
                }
                else
                {
                    staticFramework.retrieve(dtretrieve, FieldNm, oCtrl);
                }

                if (FieldKey)
                {
                    HtmlInputHidden hCtrl = (HtmlInputHidden)TableInput.FindControl("h_" + FieldNm);
                    staticFramework.retrieve(dtretrieve, FieldNm, hCtrl);
                }

                if (locked)
                {
                    HtmlInputHidden lCtrl = (HtmlInputHidden)TableInput.FindControl("l_" + FieldNm);
                    staticFramework.retrieve(dtretrieve, FieldNm, lCtrl);
                }
            }
        }
 public HiddenMatchSearchBinder(HtmlInputHidden c)
     : this(c, c.ID, "=")
 {
 }
Пример #16
0
    protected void lvDisplayVariations_OnItemDataBound(object sender, DataListItemEventArgs e)
    {
        switch (e.Item.ItemType)
            {
                case  ListItemType.Item:
                case ListItemType.AlternatingItem:

                    DataRowView dtRow =  (DataRowView) e.Item.DataItem;
                    hdnIndex = (HtmlInputHidden)e.Item.FindControl("hdnIndex");

                    style = dtRow[2].ToString().Substring(dtRow[2].ToString().IndexOf(':')+1, dtRow[2].ToString().IndexOf(';') - dtRow[2].ToString().IndexOf(':') -1);
                   /// style = " " + style + " ; display:block; border:solid 2px black; width:12px; height:12px;";

                      HtmlContainerControl vv = (HtmlContainerControl)e.Item.FindControl("vv");
                    hdnIndex.Value =  e.Item.ItemIndex.ToString();///
                    index  = e.Item.ItemIndex ;
                    vv.Attributes.Add("onmouseover", "setvalue(" + index + ")");
                    vv.Style.Add("background-color", style);
                    break;

            }
    }
Пример #17
0
 protected void MagicItemCommand(object sender, MagicItemEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         #region  除
         bool deleted = false;
         using (ISession session = new Session())
         {
             session.BeginTransaction();
             try
             {
                 foreach (RepeaterItem item in this.rptPO.Items)
                 {
                     HtmlInputCheckBox chk       = item.FindControl("checkbox") as HtmlInputCheckBox;
                     HtmlInputHidden   hidStatus = item.FindControl("hidStatus") as HtmlInputHidden;
                     if (chk != null && chk.Checked && !string.IsNullOrEmpty(chk.Value))
                     {
                         if (Cast.Enum <POStatus>(hidStatus.Value) == POStatus.New)
                         {
                             session.CreateEntityQuery <POLine>()
                             .Where(Exp.Eq("OrderNumber", chk.Value))
                             .Delete();
                             POHead.Delete(session, chk.Value);
                             deleted = true;
                         }
                     }
                 }
                 session.Commit();
                 if (deleted)
                 {
                     this.QueryAndBindData(session, this.magicPagerMain.CurrentPageIndex, this.magicPagerMain.PageSize, true);
                     WebUtil.ShowMsg(this, "选择的采购订单已经被删除", "操作成功");
                 }
             }
             catch (Exception ex)
             {
                 session.Rollback();
                 WebUtil.ShowError(this, ex);
             }
         }
         #endregion
     }
     else if (e.CommandName == "Complete")
     {
         #region 关闭采购订单
         bool completed = false;
         using (ISession session = new Session())
         {
             session.BeginTransaction();
             try
             {
                 foreach (RepeaterItem item in this.rptPO.Items)
                 {
                     HtmlInputCheckBox chk = item.FindControl("checkbox") as HtmlInputCheckBox;
                     if (chk != null && chk.Checked && !string.IsNullOrEmpty(chk.Value))
                     {
                         POHead poHead = POHead.Retrieve(session, chk.Value);
                         if (poHead.Status == POStatus.Release && poHead.ApproveResult == ApproveStatus.Approve)
                         {
                             poHead.Close(session);
                             completed = true;
                         }
                     }
                 }
                 session.Commit();
             }
             catch (Exception er)
             {
                 session.Rollback();
                 WebUtil.ShowError(this, er);
             }
             if (completed)
             {
                 this.QueryAndBindData(session, this.magicPagerMain.CurrentPageIndex, this.magicPagerMain.PageSize, true);
                 WebUtil.ShowMsg(this, "选择的采购订单已经完成", "操作成功");
             }
         }
         #endregion
     }
     else if (e.CommandName == "Publish")
     {
         #region 发布(送签单据)
         bool published = false;
         using (ISession session = new Session())
         {
             session.BeginTransaction();
             try
             {
                 foreach (RepeaterItem item in this.rptPO.Items)
                 {
                     HtmlInputCheckBox chk = item.FindControl("checkbox") as HtmlInputCheckBox;
                     if (chk != null && chk.Checked && !string.IsNullOrEmpty(chk.Value))
                     {
                         POHead poHead = POHead.Retrieve(session, chk.Value.Trim());
                         if (poHead.Status == POStatus.New)//为新建状态
                         {
                             poHead.Release(session);
                             published = true;
                         }
                     }
                 }
                 session.Commit();
             }
             catch (Exception er)
             {
                 session.Rollback();
                 WebUtil.ShowError(this, er);
             }
             if (published)
             {
                 this.QueryAndBindData(session, this.magicPagerMain.CurrentPageIndex, this.magicPagerMain.PageSize, true);
                 WebUtil.ShowMsg(this, "选择的采购订单已经发布", "操作成功");
             }
         }
         #endregion
     }
 }
Пример #18
0
        /// <summary>
        /// Renders the base control.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderBaseControl(HtmlTextWriter writer)
        {
            Dictionary <string, string> values = null;

            if (DefinedTypeId.HasValue)
            {
                values = new Dictionary <string, string>();
                new DefinedValueService(new RockContext())
                .GetByDefinedTypeId(DefinedTypeId.Value)
                .ToList()
                .ForEach(v => values.Add(v.Id.ToString(), v.Value));
            }
            else if (CustomValues != null)
            {
                values = CustomValues;
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "key-value-list " + this.CssClass);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            writer.WriteLine();

            _hfValue.RenderControl(writer);
            _hfValueDisableVrm.RenderControl(writer);

            writer.WriteLine();

            StringBuilder html = new StringBuilder();

            html.Append(@"<div class=""controls controls-row form-control-group"">");

            // write key/value html
            if (this.DisplayValueFirst)
            {
                WriteValueHtml(html, values);
                WriteKeyHtml(html);
            }
            else
            {
                WriteKeyHtml(html);
                WriteValueHtml(html, values);
            }


            html.Append(@"<a href=""#"" class=""btn btn-sm btn-danger key-value-remove""><i class=""fa fa-times""></i></a></div>");

            var hfValueHtml = new HtmlInputHidden();

            hfValueHtml.AddCssClass("js-value-html");
            hfValueHtml.Value = html.ToString();
            hfValueHtml.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "key-value-rows");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            writer.WriteLine();

            string[] nameValues = this.Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string nameValue in nameValues)
            {
                string[] nameAndValue = nameValue.Split(new char[] { '^' });
                nameAndValue = nameAndValue.Select(s => HttpUtility.UrlDecode(s)).ToArray();     // url decode array items

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "controls controls-row form-control-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.WriteLine();

                if (DisplayValueFirst)
                {
                    WriteValueControls(writer, nameAndValue, values);
                    WriteKeyControls(writer, nameAndValue);
                }
                else
                {
                    WriteKeyControls(writer, nameAndValue);
                    WriteValueControls(writer, nameAndValue, values);
                }

                // Write Remove Button
                writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-sm btn-danger key-value-remove");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-times");
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();
                writer.WriteLine();

                writer.RenderEndTag();
                writer.WriteLine();
            }

            writer.RenderEndTag();
            writer.WriteLine();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-actions");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            var addButtonCssClass = "btn btn-action btn-square btn-xs key-value-add";

            if (!this.Enabled)
            {
                addButtonCssClass += " aspNetDisabled disabled";
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, addButtonCssClass);
            writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-plus-circle");
            writer.RenderBeginTag(HtmlTextWriterTag.I);

            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.WriteLine();

            writer.RenderEndTag();
            writer.WriteLine();
        }
Пример #19
0
        private void dgJobsToBookIn_ItemContentCreated(object sender, GridItemContentCreatedEventArgs e)
        {
            try
            {
                int jobId = Convert.ToInt32(((HtmlInputHidden)e.Content.FindControl("hidJobId")).Value);

                if (jobId > 0)
                {
                    DataView dvJobRow = new DataView(m_dsJobsData.Tables[0]);
                    dvJobRow.RowFilter = "JobId = " + jobId.ToString();
                    eJobState jobState = (eJobState)Enum.Parse(typeof(eJobState), ((string)dvJobRow.Table.Rows[0]["JobState"]).Replace(" ", ""), true);

                    HtmlInputHidden hidJobState = (HtmlInputHidden)e.Content.FindControl("hidJobState");
                    HtmlInputHidden hidJobType  = (HtmlInputHidden)e.Content.FindControl("hidJobType");

                    if (hidJobState != null && hidJobType != null)
                    {
                        eJobType jobType = (eJobType)Enum.Parse(typeof(eJobType), ((string)dvJobRow.Table.Rows[0]["JobType"]).Replace(" ", ""), true);

                        GridServerTemplateContainer container = (GridServerTemplateContainer)e.Content;

                        if (jobState == eJobState.Booked || jobState == eJobState.Planned || jobState == eJobState.InProgress)
                        {
                            Facade.IJob facJob = new Facade.Job();
                            ((HtmlImage)e.Content.FindControl("imgRequiresCallIn")).Visible = facJob.RequiresCallIn(jobId);
                        }
                        else
                        {
                            ((HtmlImage)e.Content.FindControl("imgRequiresCallIn")).Visible = false;
                        }

                        HtmlImage imgHasRequests = (HtmlImage)e.Content.FindControl("imgHasRequests");
                        if (((int)dvJobRow[0]["Requests"]) == 0)
                        {
                            imgHasRequests.Visible = false;
                        }
                        else
                        {
                            imgHasRequests.Visible = true;
                            imgHasRequests.Attributes.Add("onClick", "javascript:ShowPlannerRequests('" + jobId.ToString() + "');");
                        }

                        HtmlAnchor lnkEditJob = (HtmlAnchor)e.Content.FindControl("lnkEditJob");
                        switch (jobType)
                        {
                        case eJobType.Normal:
                            lnkEditJob.HRef = "javascript:openResizableDialogWithScrollbars('../job/wizard/wizard.aspx?jobId=" + jobId.ToString() + "', '623', '508');";
                            break;

                        case eJobType.PalletReturn:
                            lnkEditJob.HRef = "../job/addupdatepalletreturnjob.aspx?jobId=" + jobId.ToString();
                            break;

                        case eJobType.Return:
                            lnkEditJob.HRef = "../job/addupdategoodsreturnjob.aspx?jobId=" + jobId.ToString();
                            break;

                        default:
                            lnkEditJob.Visible = false;
                            break;
                        }
                    }

                    Table tblCollections = (Table)e.Content.FindControl("tblCollections");
                    if (tblCollections != null)
                    {
                        tblCollections.BackColor = Utilities.GetJobStateColour(jobState);
                        DataView dvCollections = new DataView(m_dsJobsData.Tables[1]);
                        foreach (DataRow collection in dvCollections.Table.Rows)
                        {
                            if ((int)collection["JobId"] == jobId)
                            {
                                // This is a collection for the current job
                                ArrayList rows = CreateTableRows(collection);
                                foreach (TableRow row in rows)
                                {
                                    tblCollections.Rows.Add(row);
                                }
                            }
                        }
                    }

                    Table tblDeliveries = (Table)e.Content.FindControl("tblDeliveries");
                    if (tblDeliveries != null)
                    {
                        tblDeliveries.BackColor = Utilities.GetJobStateColour(jobState);
                        DataView dvDeliveries = new DataView(m_dsJobsData.Tables[2]);
                        foreach (DataRow delivery in dvDeliveries.Table.Rows)
                        {
                            if ((int)delivery["JobId"] == jobId)
                            {
                                // This is a delivery for the current job
                                ArrayList rows = CreateTableRows(delivery);
                                foreach (TableRow row in rows)
                                {
                                    tblDeliveries.Rows.Add(row);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                string error = exc.Message;
            }
        }
Пример #20
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["bargainId"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            this.litProdcutName              = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription         = (Literal)this.FindControl("litShortDescription");
            this.litSalePrice                = (Literal)this.FindControl("litSalePrice");
            this.litFloorPrice               = (Literal)this.FindControl("litFloorPrice");
            this.litFloorPrice1              = (Literal)this.FindControl("litFloorPrice1");
            this.litPurchaseNumber           = (Literal)this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (Literal)this.FindControl("litParticipantNumber");
            this.litProductDesc              = (Literal)this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (Literal)this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (Literal)this.FindControl("litProductCommentTotal");
            this.litStock           = (Literal)this.FindControl("litStock");
            this.hiddHasCollected   = (HtmlInputHidden)this.FindControl("hiddHasCollected");
            this.hiddProductId      = (HtmlInputHidden)this.FindControl("hiddProductId");
            this.hideTitle          = (HtmlInputHidden)this.FindControl("hideTitle");
            this.hideImgUrl         = (HtmlInputHidden)this.FindControl("hideImgUrl");
            this.hideDesc           = (HtmlInputHidden)this.FindControl("hideDesc");
            this.hiddEndDate        = (HtmlInputHidden)this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (HtmlInputHidden)this.FindControl("hiddPurchaseNumber");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            MemberInfo  currentMember = MemberProcessor.GetCurrentMember();
            bool        flag          = false;
            BargainInfo bargainInfo   = BargainHelper.GetBargainInfo(this.bargainId);

            if (bargainInfo != null)
            {
                this.hideTitle.Value = bargainInfo.Title;
                this.hideDesc.Value  = bargainInfo.Remarks;
                Uri    url           = HttpContext.Current.Request.Url;
                string activityCover = bargainInfo.ActivityCover;
                string str2          = string.Empty;
                if (!activityCover.StartsWith("http"))
                {
                    str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                int id = Globals.RequestQueryNum("bargainDetialId");
                if (id > 0)
                {
                    BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(id);
                    if ((currentMember == null) || (((currentMember != null) && (bargainDetialInfo != null)) && (bargainDetialInfo.UserId != currentMember.UserId)))
                    {
                        HttpContext.Current.Response.Redirect(string.Concat(new object[] { "HelpBargainDetial.aspx?bargainId=", this.bargainId, "&bargainDetialId=", id }));
                        HttpContext.Current.Response.End();
                    }
                }
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litFloorPrice1.Text       = bargainInfo.FloorPrice.ToString("F2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.HelpBargainCount(this.bargainId).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                    this.litProdcutName.Text      = productDetails.ProductName;
                    this.litShortDescription.Text = productDetails.ShortDescription;
                    this.litSalePrice.Text        = productDetails.MinSalePrice.ToString("f2");
                    this.litProductDesc.Text      = productDetails.Description;
                    this.hideImgUrl.Value         = string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str2 + activityCover) : (str2 + productDetails.ThumbnailUrl60);
                    if (this.rptProductImages != null)
                    {
                        string       locationUrl = "javascript:;";
                        SlideImage[] imageArray  = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                        this.rptProductImages.DataSource = from item in imageArray
                                                           where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                           select item;
                        this.rptProductImages.DataBind();
                    }
                    int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                    this.litProductConsultationTotal.SetWhenIsNotNull(productConsultationsCount.ToString());
                    this.litProductCommentTotal.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId).ToString());
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
        }
Пример #21
0
        protected void gvPosition_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            HtmlInputHidden key = (HtmlInputHidden)gvPosition.Rows[e.RowIndex].Cells[0].FindControl("Positionid");

            string sID     = key.Value;
            string sName   = ((TextBox)(gvPosition.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim();
            string sDesc   = ((TextBox)(gvPosition.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim();
            string sWeight = ((TextBox)(gvPosition.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim();
            //DropDownList需要采用此类方法
            string sHand  = ((DropDownList)(gvPosition.Rows[e.RowIndex].Cells[4].FindControl("ddlHand"))).SelectedValue;
            string sShift = ((DropDownList)(gvPosition.Rows[e.RowIndex].Cells[5].FindControl("ddlShift"))).SelectedValue;
            string sValid = ((DropDownList)(gvPosition.Rows[e.RowIndex].Cells[6].FindControl("ddlValid"))).SelectedValue;
            string sNote  = ((TextBox)(gvPosition.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim();

            string msg = "";

            if (sName == "")
            {
                msg += "名称不能为空!\r\n";
            }

            //判断double格式
            if (!Regex.IsMatch(sWeight, @"^\d*[.]?\d*$"))
            {
                msg += "权重只能为数字组成!\r\n";
            }

            if (msg != "")
            {
                MessageBox.popupClientMessage(this.Page, msg);
                return;
            }

            //代码是否重复
            if (KPI_PositionDal.PositionNameExists(sName, sID))
            {
                MessageBox.popupClientMessage(this.Page, "已存在相同的代码!");
                return;
            }

            //更新
            KPI_PositionEntity ote = new KPI_PositionEntity();

            ote.PositionID         = sID;
            ote.PositionName       = sName;
            ote.PositionDesc       = sDesc;
            ote.PositionWeight     = double.Parse(sWeight);
            ote.PositionIsHand     = sHand;
            ote.PositionIsShift    = sShift;
            ote.PositionIsValid    = sValid;
            ote.PositionNote       = sNote;
            ote.PositionModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");

            if (KPI_PositionDal.Update(ote))
            {
                MessageBox.popupClientMessage(this.Page, "编辑成功!", "call();");
            }
            else
            {
                MessageBox.popupClientMessage(this.Page, "编辑错误!", "call();");
            }

            gvPosition.EditIndex = -1;

            BindPosition();
        }
Пример #22
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        PageErrors errors = PageErrors.getErrors(db, Page.Master);

        errors.clear();

        ArrayList list = new ArrayList();

        foreach (DataListItem item in Repeater.Items)
        {
            CheckBox        c = (CheckBox)item.FindControl("DeleteItem");
            HtmlInputHidden h = (HtmlInputHidden)item.FindControl("CostCenterID");
            if (c.Checked)
            {
                ECostCenter obj = new ECostCenter();
                obj.CostCenterID = Int32.Parse(h.Value);
                list.Add(obj);
            }
        }
        foreach (ECostCenter obj in list)
        {
            if (ECostCenter.db.select(dbConn, obj))
            {
                {
                    DBFilter costAllocationDetailFilter = new DBFilter();
                    costAllocationDetailFilter.add(new Match("cad.CostCenterID", obj.CostCenterID));

                    DBFilter costAllocationFilter = new DBFilter();
                    costAllocationFilter.add(new IN("CostAllocationID", "SELECT DISTINCT cad.CostAllocationID FROM " + ECostAllocationDetail.db.dbclass.tableName + " cad", costAllocationDetailFilter));
                    costAllocationFilter.add("empid", true);
                    ArrayList CostAllocationList = ECostAllocation.db.select(dbConn, costAllocationFilter);
                    if (CostAllocationList.Count > 0)
                    {
                        int lastEmpID = 0;
                        errors.addError(string.Format(HROne.Translation.PageErrorMessage.ERROR_CODE_USED_BY_EMPLOYEE, new string[] { HROne.Common.WebUtility.GetLocalizedString("Cost Center Code"), obj.CostCenterCode }));
                        foreach (ECostAllocation costAllocation in CostAllocationList)
                        {
                            if (lastEmpID != costAllocation.EmpID)
                            {
                                EEmpPersonalInfo empInfo = new EEmpPersonalInfo();
                                empInfo.EmpID = costAllocation.EmpID;
                                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                                {
                                    errors.addError("- " + empInfo.EmpNo + ", " + empInfo.EmpEngFullName);
                                    lastEmpID = costAllocation.EmpID;
                                }
                                else
                                {
                                    ECostAllocation.db.delete(dbConn, costAllocation);
                                }
                            }
                        }
                        errors.addError(HROne.Translation.PageErrorMessage.ERROR_ACTION_ABORT);
                        view = loadData(info, db, Repeater);
                        return;
                    }
                }
                {
                    DBFilter empCostCenterDetailFilter = new DBFilter();
                    empCostCenterDetailFilter.add(new Match("eccd.CostCenterID", obj.CostCenterID));

                    DBFilter empCostCenterFilter = new DBFilter();
                    empCostCenterFilter.add(new IN("EmpCostCenterID", "SELECT DISTINCT eccd.CostCenterID FROM " + EEmpCostCenterDetail.db.dbclass.tableName + " eccd", empCostCenterDetailFilter));
                    empCostCenterFilter.add("empid", true);
                    ArrayList empCostCenterList = EEmpCostCenter.db.select(dbConn, empCostCenterFilter);
                    if (empCostCenterList.Count > 0)
                    {
                        int lastEmpID = 0;
                        errors.addError(string.Format(HROne.Translation.PageErrorMessage.ERROR_CODE_USED_BY_EMPLOYEE, new string[] { HROne.Common.WebUtility.GetLocalizedString("Cost Center Code"), obj.CostCenterCode }));
                        foreach (EEmpCostCenter empCostCenter in empCostCenterList)
                        {
                            if (lastEmpID != empCostCenter.EmpID)
                            {
                                EEmpPersonalInfo empInfo = new EEmpPersonalInfo();
                                empInfo.EmpID = empCostCenter.EmpID;
                                if (EEmpPersonalInfo.db.select(dbConn, empInfo))
                                {
                                    errors.addError("- " + empInfo.EmpNo + ", " + empInfo.EmpEngFullName);
                                    lastEmpID = empCostCenter.EmpID;
                                }
                                else
                                {
                                    EEmpCostCenter.db.delete(dbConn, empCostCenter);
                                }
                            }
                        }
                        errors.addError(HROne.Translation.PageErrorMessage.ERROR_ACTION_ABORT);
                        view = loadData(info, db, Repeater);
                        return;
                    }
                }
                if (errors.isEmpty())
                {
                    WebUtils.StartFunction(Session, FUNCTION_CODE);
                    db.delete(dbConn, obj);
                    WebUtils.EndFunction(dbConn);
                }
            }
        }
        view = loadData(info, db, Repeater);
    }
Пример #23
0
        private void ReBuildTable()
        {
            const string METHOD_NAME = "ReBuildTable";

            try
            {
                int    crop_year = Convert.ToInt16(ddlCropYear.Text);
                string shid      = txtSHID.Text;

                List <Contract> contractList = BeetDataContract.GetContracts(shid, crop_year, 0);

                if (contractList != null && contractList.Count > 0)
                {
                    TableHeaderRow headerRow = new TableHeaderRow();

                    TableHeaderCell h1 = new TableHeaderCell();
                    h1.Text = "Contract No";
                    headerRow.Cells.Add(h1);

                    TableHeaderCell h2 = new TableHeaderCell();
                    h2.Text = "PAC Dues";
                    headerRow.Cells.Add(h2);

                    contractTable.Rows.Add(headerRow);

                    for (int i = 0; i < contractList.Count; i++)
                    {
                        TableRow row = new TableRow();

                        TableCell cell1 = new TableCell();
                        cell1.Text = Convert.ToString(contractList[i].contractNo);
                        row.Cells.Add(cell1);

                        TableCell cell2 = new TableCell();
                        cell2.Text = Convert.ToString(contractList[i].pacDues);
                        row.Cells.Add(cell2);

                        contractTable.Rows.Add(row);
                    }
                }

                if (IndTable.Count > 0)
                {
                    TableHeaderRow headerRow = new TableHeaderRow();

                    TableHeaderCell hshid = new TableHeaderCell();
                    hshid.Text = "SHID";
                    headerRow.Cells.Add(hshid);

                    TableHeaderCell h1 = new TableHeaderCell();
                    h1.Text = "Sort";
                    headerRow.Cells.Add(h1);

                    TableHeaderCell h2 = new TableHeaderCell();
                    h2.Text = "Individual";
                    headerRow.Cells.Add(h2);

                    TableHeaderCell hEmail = new TableHeaderCell();
                    hEmail.Text = "Email";
                    headerRow.Cells.Add(hEmail);

                    TableHeaderCell h3 = new TableHeaderCell();
                    h3.Text = "Individual Id";
                    h3.Attributes.Add("style", "display: none");
                    headerRow.Cells.Add(h3);

                    TableHeaderCell h4 = new TableHeaderCell();
                    h4.Text = "Percent";
                    headerRow.Cells.Add(h4);

                    TableHeaderCell h5 = new TableHeaderCell();
                    h5.Text = "Signature Date";
                    headerRow.Cells.Add(h5);

                    TableHeaderCell h6 = new TableHeaderCell();
                    h6.Text = "Remove";
                    headerRow.Cells.Add(h6);

                    indTable.Rows.Add(headerRow);

                    for (int i = 0; i < this.IndTable.Count; i++)
                    {
                        var ind = PACData.GetPACIndividuals(this.IndTable[i].IndividualID, null)[0];

                        TableRow row = new TableRow();

                        TableCell cellshid = new TableCell();
                        cellshid.Text = GetShid(ind.SHID.ToString());
                        row.Cells.Add(cellshid);

                        TableCell cell1 = new TableCell();
                        TextBox   Sort  = new TextBox();
                        Sort.ID        = "Sort_" + i;
                        Sort.Width     = 15;
                        Sort.MaxLength = 1;
                        Sort.Attributes.Add("runat", "server");
                        Sort.Attributes.Add("class", "sort");
                        Sort.Text = Convert.ToString(this.IndTable[i].Sort).Trim();
                        cell1.Controls.Add(Sort);
                        row.Cells.Add(cell1);

                        TableCell cell2 = new TableCell();
                        cell2.Text  = ind.FullName;
                        cell2.Width = 150;
                        row.Cells.Add(cell2);

                        TableCell cellEmail = new TableCell();
                        cellEmail.Text  = ind.Email;
                        cellEmail.Width = 150;
                        row.Cells.Add(cellEmail);

                        TableCell       cell3 = new TableCell();
                        HtmlInputHidden IndId = new HtmlInputHidden();
                        IndId.ID    = "IndividualID_" + i;
                        IndId.Value = Convert.ToString(this.IndTable[i].IndividualID);
                        IndId.Attributes.Add("class", "individualid");
                        cell3.Controls.Add(IndId);
                        cell3.Attributes.Add("style", "display: none");
                        row.Cells.Add(cell3);

                        TableCell cell4      = new TableCell();
                        TextBox   Percentage = new TextBox();
                        Percentage.ID        = "Percentage_" + i;
                        Percentage.Width     = 25;
                        Percentage.MaxLength = 5;
                        Percentage.Attributes.Add("runat", "server");
                        Percentage.Attributes.Add("class", "percentage");
                        Percentage.Text = Convert.ToString(this.IndTable[i].Percentage);
                        cell4.Controls.Add(Percentage);
                        row.Cells.Add(cell4);

                        /*
                         * TableCell cell4 = new TableCell();
                         * HtmlInputCheckBox Signed = new HtmlInputCheckBox();
                         * Signed.ID = "Signed_" + i;
                         * Signed.Checked = this.IndTable[i].Signed;
                         * Signed.Attributes.Add("runat", "server");
                         * Signed.Attributes.Add("class", "signed");
                         * cell4.Controls.Add(Signed);
                         * row.Cells.Add(cell4);
                         */

                        TableCell     cell5      = new TableCell();
                        HtmlInputText SignedDate = new HtmlInputText();
                        SignedDate.ID   = "SignedDate_" + i;
                        SignedDate.Size = 10;
                        if (this.IndTable[i].Signed)
                        {
                            SignedDate.Value = this.IndTable[i].SignedDate.ToString("MM/dd/yyyy");
                        }
                        SignedDate.Attributes.Add("class", "signedDate");
                        SignedDate.Attributes.Add("onclick", "JavaScript:LaunchDatePicker(this);");
                        cell5.Controls.Add(SignedDate);
                        row.Cells.Add(cell5);

                        TableCell cell6 = new TableCell();
                        cell6.Attributes.Add("style", "text-align: center;");
                        HtmlAnchor anchor = new HtmlAnchor();
                        anchor.HRef      = "javascript:void(0);";
                        anchor.InnerText = "X";
                        anchor.Attributes.Add("onclick", "DeleteIndRow(this);");
                        cell6.Controls.Add(anchor);
                        row.Cells.Add(cell6);

                        indTable.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Пример #24
0
        private void ProductBusiness()
        {
            if (this.ProductInfo != null)
            {
                this.BuildSku();
                HtmlInputHidden htmlInputHidden = this.hidden_StoreId;
                int             num             = this.ProductInfo.StoreId;
                htmlInputHidden.Value = num.ToString();
                HtmlInputHidden htmlInputHidden2 = this.hidden_SKUSubmitOrderProductId;
                num = this.ProductInfo.ProductId;
                htmlInputHidden2.Value = num.ToString();
                this.imgSKUSubmitOrderProduct.ImageUrl = this.ProductInfo.SubmitOrderImg;
                this.lblSKUSubmitOrderPrice.Text       = this.ProductInfo.MinSalePrice.F2ToString("f2");
                Label label = this.lblSKUSubmitOrderStockNow;
                num        = this.ProductInfo.Stock;
                label.Text = num.ToString();
                this.hidden_SKUSubmitOrderProductMinPrice.Value = this.ProductInfo.MinSalePrice.F2ToString("f2");
                HtmlInputHidden htmlInputHidden3 = this.hidden_SKUSubmitOrderProductStock;
                num = this.ProductInfo.Stock;
                htmlInputHidden3.Value = num.ToString();
                this.buyButton.Visible = false;
                if (this.IsServiceProduct)
                {
                    this.btnAddCart.Visible = false;
                    this.buyButton.Style.Add("width", "100%");
                    this.buyButton.Visible = true;
                }
                else
                {
                    string str = "<div id=\"addcartButton2\" style='float: left;width:50% ' type=\"shoppingBtn\" class=\"add_cart\">加入购物车</div>";
                    switch (this.ProductInfo.ExStatus)
                    {
                    case DetailException.StopService:
                    {
                        DateTime value;
                        if (this.CountDownId > 0)
                        {
                            Literal literal = this.ltlBottomStatus;
                            value        = this.ProductInfo.StoreInfo.CloseEndTime.Value;
                            literal.Text = string.Format("<h4>歇业中</h4><p>营业时间:{0}</p>", value.ToString("yyyy年MM月dd号 HH:mm"));
                        }
                        else
                        {
                            value = this.ProductInfo.StoreInfo.CloseEndTime.Value;
                            string text = string.Format("歇业中 营业时间:{0}</ p > ", value.ToString("yyyy年MM月dd号 HH:mm"));
                            this.setBuyButtonEx(text);
                            this.ltlBottomStatus.Text = text;
                        }
                        break;
                    }

                    case DetailException.NoStock:
                        this.setBuyButtonEx("已售罄");
                        this.ltlBottomStatus.Text = "已售罄";
                        break;

                    case DetailException.OverServiceArea:
                        this.setBuyButtonEx("服务范围超区");
                        this.ltlBottomStatus.Text = ((this.CountDownId > 0) ? "服务范围超区" : "<div id=\"addcartButton2\" class=\"add_cart b_r_0 mg_0 addcartFunction\" style=\"width:50%;float: left\">加入购物车</div><div class=\"chaoqu\">服务范围超区</div>");
                        break;

                    case DetailException.IsNotWorkTime:
                        if (this.CountDownId > 0)
                        {
                            this.ltlBottomStatus.Text = "<div class=\"nottheTime\">非营业时间</div>";
                        }
                        else if (base.site.Store_IsOrderInClosingTime)
                        {
                            this.ltlBottomStatus.Text = str + " <button class=\"buy b_r_0 mg_0\" id=\"buyButton\" style=\"width: 50%\">立即购买</button>";
                        }
                        else
                        {
                            this.buyButton.Visible    = true;
                            this.ltlBottomStatus.Text = str + "<div class=\"nottheTime\">非营业时间</div>";
                        }
                        break;

                    default:
                        this.buyButton.Visible = true;
                        if (this.CountDownId > 0)
                        {
                            if (this.CountDownInfo.IsJoin)
                            {
                                this.ltlBottomStatus.Text = " <button class=\"buy b_r_0 mg_0\" id=\"buyButton\" onclick='BuyProduct()' style=\"width: 100%\">立即购买</button>";
                            }
                        }
                        else
                        {
                            this.ltlBottomStatus.Text = " <button id=\"btnAddCart\" class=\"add_cart btn b_r_0 mg_0 addcartFunction\" style=\"width: 50%\">加入购物车</button><button class=\"btn btn-warning btn-yes\" id=\"buyButton\"  onclick='BuyProduct()' style=\"width: 50%\">立即购买</button>";
                        }
                        break;
                    }
                }
            }
        }
Пример #25
0
        protected override void AttachChildControls()
        {
            this.hidurl = (HtmlInputHidden)this.FindControl("hidurl");
            string       userAgent      = this.Page.Request.UserAgent;
            MemberInfo   currentMember  = MemberProcessor.GetCurrentMember();
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true, wid);

            if (((currentMember == null) || (this.Page.Session["userid"] == null)) || (this.Page.Session["userid"].ToString() != currentMember.UserId.ToString()))
            {
                if (userAgent.ToLower().Contains("micromessenger"))
                {
                    if (masterSettings.IsValidationService)
                    {
                        string msg = this.Page.Request.QueryString["code"];
                        this.WriteError(msg, "code值");
                        if (!string.IsNullOrEmpty(msg))
                        {
                            string responseResult = this.GetResponseResult("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + masterSettings.WeixinAppId + "&secret=" + masterSettings.WeixinAppSecret + "&code=" + msg + "&grant_type=authorization_code");
                            if (responseResult.Contains("access_token"))
                            {
                                this.WriteError(responseResult, "access_token");
                                JObject obj2 = JsonConvert.DeserializeObject(responseResult) as JObject;
                                if (!this.HasLogin(obj2["openid"].ToString()))
                                {
                                    string str4 = this.GetResponseResult("https://api.weixin.qq.com/sns/userinfo?access_token=" + obj2["access_token"].ToString() + "&openid=" + obj2["openid"].ToString() + "&lang=zh_CN");
                                    if (str4.Contains("nickname"))
                                    {
                                        JObject    obj3       = JsonConvert.DeserializeObject(str4) as JObject;
                                        string     generateId = Globals.GetGenerateId();
                                        MemberInfo member     = new MemberInfo {
                                            GradeId        = MemberProcessor.GetDefaultMemberGrade(this.wid),
                                            UserName       = Globals.UrlDecode(obj3["nickname"].ToString()),
                                            OpenId         = obj3["openid"].ToString(),
                                            CreateDate     = DateTime.Now,
                                            SessionId      = generateId,
                                            SessionEndTime = DateTime.Now.AddDays(10),
                                            UserHead       = obj3["headimgurl"].ToString(),
                                            Password       = HiCryptographer.Md5Encrypt("888888")
                                        };
                                        MemberProcessor.CreateMember(member);
                                        MemberInfo info3  = MemberProcessor.GetMember(generateId);
                                        HttpCookie cookie = new HttpCookie("Vshop-Member")
                                        {
                                            Value   = info3.UserId.ToString(),
                                            Expires = DateTime.Now.AddDays(10)
                                        };
                                        HttpContext.Current.Response.Cookies.Add(cookie);
                                        this.Page.Session["userid"] = info3.UserId.ToString();
                                        DistributorsInfo userIdDistributors = new DistributorsInfo();
                                        userIdDistributors = DistributorsBrower.GetUserIdDistributors(info3.UserId);
                                        if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
                                        {
                                            HttpCookie cookie2 = new HttpCookie("Vshop-ReferralId")
                                            {
                                                Value   = userIdDistributors.UserId.ToString(),
                                                Expires = DateTime.Now.AddDays(1)
                                            };
                                            HttpContext.Current.Response.Cookies.Add(cookie2);
                                        }
                                        this.hidurl.Value = this.Page.Request.QueryString["returnUrl"];
                                    }
                                    else
                                    {
                                        this.Page.Response.Redirect(Globals.ApplicationPath + "/Default.aspx");
                                    }
                                }
                                else
                                {
                                    MemberInfo openIdMember = MemberProcessor.GetOpenIdMember(obj2["openid"].ToString());
                                    HttpCookie cookie3      = new HttpCookie("Vshop-Member")
                                    {
                                        Value   = openIdMember.UserId.ToString(),
                                        Expires = DateTime.Now.AddDays(10)
                                    };
                                    HttpContext.Current.Response.Cookies.Add(cookie3);
                                    this.Page.Session["userid"] = openIdMember.UserId.ToString();
                                    DistributorsInfo info6 = new DistributorsInfo();
                                    info6 = DistributorsBrower.GetUserIdDistributors(openIdMember.UserId);
                                    if ((info6 != null) && (info6.UserId > 0))
                                    {
                                        HttpCookie cookie4 = new HttpCookie("Vshop-ReferralId")
                                        {
                                            Value   = info6.UserId.ToString(),
                                            Expires = DateTime.Now.AddDays(1)
                                        };
                                        HttpContext.Current.Response.Cookies.Add(cookie4);
                                    }
                                    this.WriteError("会员OpenId已绑定过会员帐号已自动登陆!", obj2["openid"].ToString());
                                    this.hidurl.Value = this.Page.Request.QueryString["returnUrl"];
                                }
                            }
                            else
                            {
                                this.Page.Response.Redirect(Globals.ApplicationPath + "/Default.aspx");
                            }
                        }
                        else if (!string.IsNullOrEmpty(this.Page.Request.QueryString["state"]))
                        {
                            this.Page.Response.Redirect(Globals.ApplicationPath + "/Default.aspx");
                        }
                        else
                        {
                            string str6 = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + masterSettings.WeixinAppId + "&redirect_uri=" + Globals.UrlEncode(HttpContext.Current.Request.Url.ToString()) + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
                            this.WriteError(str6, "用户授权的路径");
                            this.Page.Response.Redirect(str6);
                        }
                    }
                    else
                    {
                        this.Page.Response.Redirect(Globals.ApplicationPath + "/UserLogin.aspx?returnUrl=" + this.Page.Request.QueryString["returnUrl"]);
                    }
                }
                else if (this.Page.Request.Cookies["Vshop-Member"] == null)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/UserLogin.aspx?returnUrl=" + this.Page.Request.QueryString["returnUrl"]);
                }
            }
        }
Пример #26
0
        private void SubmitAlarm(string strIndex, bool AddAlarm)
        {
            //逾時處理
            if (object.Equals(null, Session["g_UserID"]))
            {
                //定位到登錄頁面
                Public_Helper.CallJavascriptEvent(this, "LoginOut", "GoToDefaultUrl();", true);
            }
            try
            {
                OutBoundEntity  objOutBoundEntity = new OutBoundEntity();
                OutBoundOperate objOutBoundOpe    = new OutBoundOperate();
                IssueOperate    objIssueOperate   = new IssueOperate();
                #region Alarm

                RadioButtonList radAlarmType = (RadioButtonList)Page.FindControl("radAlarmType" + strIndex);
                string          strAlarmType = radAlarmType.SelectedValue.Trim();
                string          strDate      = ((TextBox)Page.FindControl("txtDateTime" + strIndex)).Text.Trim();


                HtmlInputHidden hidAlarmID = (HtmlInputHidden)Page.FindControl("hidAlarmID" + strIndex);
                string          strAlarmID = hidAlarmID.Value.Trim();
                string          strAttenTo = ((HtmlInputHidden)Page.FindControl("hidAttenTo" + strIndex)).Value.Trim();
                string          strAttenCC = ((HtmlInputHidden)Page.FindControl("hidAttenCC" + strIndex)).Value.Trim();
                string          strTO      = ((TextBox)Page.FindControl("txtTo" + strIndex)).Text.Trim();
                string          strCC      = ((TextBox)Page.FindControl("txtCC" + strIndex)).Text.Trim();
                string          strSubject = "";

                strSubject = ((TextBox)Page.FindControl("txtSubject" + strIndex)).Text.Trim();

                //同步Issue
                string strUserInfo = ((TextBox)Page.FindControl("txtUserInfo")).Text.Trim();
                string strUserTel  = ((TextBox)Page.FindControl("txtTel1")).Text.Trim();

                #endregion

                #region Detail Record
                HtmlInputHidden hidOutBoundSn        = (HtmlInputHidden)Page.FindControl("hidOutBoundSn" + strIndex);
                string          strOutBoundSn        = hidOutBoundSn.Value.Trim();
                string          strChooseProductLine = "";
                RadioButtonList radProductLine       = (RadioButtonList)Page.FindControl("radProductLine" + strIndex);

                string strProductLine = radProductLine.SelectedValue.ToString();
                if (string.IsNullOrEmpty(strProductLine))
                {
                    strProductLine = ((HtmlInputHidden)Page.FindControl("hidProductLine" + strIndex)).Value.Trim();
                    //20140604 hill add code for Mina來信要求要把產品線的預設值拿掉,所以程式必修增加判斷check 使用者是否有輸入產品線
                    Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["radProductLine"].ToString() + "');", true);
                    return;
                }
                strChooseProductLine = strProductLine;
                //有果有選中子產品線
                string strSubProcuct = ((HtmlInputHidden)Page.FindControl("hidSubProductLine" + strIndex)).Value.Trim();
                #region 產品線-子產品必填檢核
                //20120622_Claire 增加OutBound子產品線檢核
                //20110511 weihua.shen 卡關功能 加入產品線若為電腦週邊配備 則子產品為必填
                //20110929 卡關功能在增加 桌上型電腦、電腦零組件、數位家庭、工作站/伺服器、企業級資訊設備、Networking & Communication
                //20120622_Claire 卡關增加 桌上型電腦strProductLine == "6"
                //20121127_Claire 卡關增加 平板電腦strProductLine =="15"
                if (strProductLine == "6" || strProductLine == "7" || strProductLine == "8" || strProductLine == "10" || strProductLine == "11" ||
                    strProductLine == "12" || strProductLine == "13" || strProductLine == "15")
                {
                    //子產品不得為0
                    if (strSubProcuct == "")
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert",
                                                          "PrivateAlertMsg('" +
                                                          ViewState["valxSubProduct"].ToString() + "');", true);
                        return;
                    }
                }

                #endregion

                if (!string.IsNullOrEmpty(strSubProcuct))
                {
                    strProductLine      += "," + strSubProcuct;
                    strChooseProductLine = strSubProcuct;
                }
                string strRelateID       = ((TextBox)Page.FindControl("txtRelateID" + strIndex)).Text.Trim();
                string strModelID        = ((TextBox)Page.FindControl("txtModel" + strIndex)).Text.Trim();
                string strClassValue     = ((HtmlInputHidden)Page.FindControl("hidClassValue" + strIndex)).Value.Trim();
                string strProductID      = ((HtmlInputHidden)Page.FindControl("hidProductID" + strIndex)).Value.Trim();
                string strProductVersion = "";
                //Model可修改時檢核
                if (((TextBox)Page.FindControl("txtModel" + strIndex)).Enabled)
                {
                    //檢核輸入的Model 是否已聯接地址一至
                    objIssueOperate.CheckModelNameLink(ref strModelID, ref strProductVersion, ref strClassValue, ref strProductID);
                }
                ((HtmlInputHidden)Page.FindControl("hidClassValue" + strIndex)).Value = strClassValue;
                ((HtmlInputHidden)Page.FindControl("hidProductID" + strIndex)).Value  = strProductID;
                //if (strModelID.IndexOf("(") != -1)
                //{
                //    strProductVersion = strModelID.Substring(strModelID.IndexOf("(") + 1, strModelID.Length - strModelID.IndexOf("(") - 2);
                //}

                string strRmaNo = ((TextBox)Page.FindControl("txtRmaNo" + strIndex)).Text.Trim();

                RadioButtonList radAction = (RadioButtonList)Page.FindControl("radAction" + strIndex);
                string          strAction = radAction.SelectedValue.Trim();

                RadioButtonList radTech   = (RadioButtonList)Page.FindControl("radTech" + strIndex);
                string          strTech   = radTech.SelectedValue.Trim();
                string          strTechQ  = ((TextBox)Page.FindControl("txtTechQ" + strIndex)).Text.Trim();
                string          strAnswer = ((TextBox)Page.FindControl("txtAnswer" + strIndex)).Text.Trim();


                HtmlInputHidden hidStartTime = (HtmlInputHidden)Page.FindControl("hidStartTime" + strIndex);
                string          strStartTime = hidStartTime.Value.Trim();
                HtmlInputHidden hidEndTime   = (HtmlInputHidden)Page.FindControl("hidEndTime" + strIndex);
                string          strEndTime   = hidEndTime.Value.Trim();
                RadioButtonList radException = (RadioButtonList)Page.FindControl("radException" + strIndex);

                string          strException  = radException.SelectedValue.Trim();
                RadioButtonList radClose      = (RadioButtonList)Page.FindControl("radClose" + strIndex);
                string          strClose      = radClose.SelectedValue.Trim();
                string          strSource     = ((DropDownList)Page.FindControl("drpSource" + strIndex)).SelectedValue.Trim();
                string          strSourceNote = "";
                //GGTS/其它選項必塡資料
                if (strSource.Equals("1") ||
                    strSource.Equals("6"))
                {
                    strSourceNote = ((TextBox)Page.FindControl("txtSource" + strIndex)).Text.Trim();
                }
                string strType1 = ((HtmlInputHidden)Page.FindControl("hidType" + strIndex)).Value.Trim();
                string strType2 = "";
                if (strType1.ToUpper().Equals("OTHERS"))
                {
                    strType2 = ((DropDownList)Page.FindControl("drpSubType" + strIndex)).SelectedValue.Trim();
                    //資料檢核必填欄位
                    if (string.IsNullOrEmpty(strType2))
                    {
                        Public_Helper.CallJavascriptEvent(this, "valrType2", "PrivateAlertMsg('" + ViewState["valrType2"].ToString() + "');", true);
                        return;
                    }
                }
                #endregion

                //主檔資料
                string strTimeCountring = "";
                string strOutBoundID    = this.txtOutBoundID.Text.Trim();
                string strWeek          = this.txtWeek.Text.Trim();
                string strUserID        = hidUserID.Value.Trim();
                //string strTel1 = this.txtTel1.Text.Trim();
                //string strTel2 = this.txtTel2.Text.Trim();
                string strCountry = this.txtCountry.Text.Trim();
                //**************************************
                //2012-04-12 個資法修正 統一整理
                string strTel1     = strPrivacy(txtTel1.Text, HidTel1.Value);
                string strTel2     = strPrivacy(txtTel2.Text, HidTel2.Value);
                string strEmail    = strPrivacy(txtEmail.Text, HidEmail.Value);
                string strAddress1 = strPrivacy(this.txtAddress1.Text, this.HidAddress1.Value);
                string strAddress2 = strPrivacy(this.txtAddress2.Text, this.HidAddress2.Value);
                //**************************************


                //********20101224 加省份**********//
                objOutBoundEntity.CITY_NAME = "";
                objOutBoundEntity.CITY_ID   = "";
                //20120809_Claire修改省份為下拉
                //string strCityID = this.txtChinaCity.Text.Trim();
                string strCityID   = this.drpChinaCity.SelectedValue.Trim();
                string strCityName = "";
                if (strCountry.Equals("086"))
                {
                    if (!string.IsNullOrEmpty(strCityID))
                    {
                        if (strCityID.Equals("其他"))
                        {
                            strCityName = this.txtChinaCityO.Text.Trim();
                            if (string.IsNullOrEmpty(strCityName))
                            {
                                //省份選其他,名稱不能為空
                                Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrCityName"].ToString() + "');", true);
                                return;
                            }
                            objOutBoundEntity.CITY_NAME = strCityName;
                            //20120809_Claire新增
                            objOutBoundEntity.CITY_ID = strCityID;
                        }
                        else
                        {
                            //20120809_Claire修改
                            //objOutBoundEntity.CITY_ID = objOutBoundOpe.GetCity_ID(strCityID.Trim());
                            objOutBoundEntity.CITY_ID = strCityID;
                            if (string.IsNullOrEmpty(objOutBoundEntity.CITY_ID))
                            {
                                //省份輸入有誤
                                Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxCity"].ToString() + "');", true);
                                return;
                            }
                        }
                    }
                    else
                    {
                        //省份沒有輸入
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrCity"].ToString() + "');", true);
                        return;
                    }
                }
                //**********************************//
                string strSex = "";
                if (radSir.Checked)
                {
                    strSex = "M";
                }
                else if (radMis.Checked)
                {
                    strSex = "F";
                }
                string str4Num = this.txt4Num.Text.Trim();
                //string strEmail = this.txtEmail.Text.Trim();
                string strUserType = drpUserType.SelectedValue.Trim();
                //string strAddress1 = this.txtAddress1.Text.Trim();
                //string strAddress2 = this.txtAddress2.Text.Trim();
                string strCustName = this.txtUserInfo.Text.Trim();

                //主檔資料未新增,檢核主檔的資料是否正確
                if (string.IsNullOrEmpty(strOutBoundID))
                {
                    //必填欄位
                    //客戶名字資料不能為空
                    if (string.IsNullOrEmpty(strCustName))
                    {
                        Public_Helper.CallJavascriptEvent(this, "valrUserInfo", "PrivateAlertMsg('" + ViewState["valrUserInfo"].ToString() + "');", true);
                        return;
                    }
                    if (string.IsNullOrEmpty(strSex))
                    {
                        Public_Helper.CallJavascriptEvent(this, "valrSex", "PrivateAlertMsg('" + ViewState["valrSex"].ToString() + "');", true);
                        return;
                    }
                    //限制字符"|"線的輸入
                    //Check_Helper checkHelper = new Check_Helper();
                    if (Check_Helper.IsBadStr(strCustName))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxUserInfo"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strTel1))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxTel1"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strTel2))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxTel2"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(str4Num))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valx4Num"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strEmail))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxEmail"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strAddress1))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxAddress1"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strAddress2))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxAddress2"].ToString() + "');", true);
                        return;
                    }
                    //20101224 加省份
                    if (Check_Helper.IsBadStr(strCityName))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxcity"].ToString() + "');", true);

                        return;
                    }

                    //長度檢核
                    #region 地址長度檢核
                    //if (150 < strAddress1.Length)
                    //{
                    //    Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenAddress1"].ToString() + "');", true);

                    //    return;
                    //}

                    //if (150 < strAddress2.Length)
                    //{
                    //    Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenAddress2"].ToString() + "');", true);

                    //    return;
                    //}

                    //20120622_Claire_修改地址長度不得少於5字元且不得超過150字元(as_resource修改)
                    if (!string.IsNullOrEmpty(strAddress1))
                    {
                        if ((strAddress1.Length < 5) || (150 < strAddress1.Length))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenAddress1"].ToString() + "');", true);

                            return;
                        }
                    }
                    if (!string.IsNullOrEmpty(strAddress2))
                    {
                        if ((strAddress2.Length < 5) || (150 < strAddress2.Length))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenAddress2"].ToString() + "');", true);

                            return;
                        }
                    }
                    #endregion
                    //20101224 加省份
                    if (50 < strCityName.Length)
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenCityName"].ToString() + "');", true);

                        return;
                    }

                    //20120622_Claire_電話長度判斷
                    #region 電話長度檢核
                    if (!string.IsNullOrEmpty(strTel1))
                    {
                        if (strTel1.Length < 5)
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenTel1"].ToString() + "');", true);
                            return;
                        }
                    }
                    if (!string.IsNullOrEmpty(strTel2))
                    {
                        if (strTel2.Length < 5)
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxLenTel2"].ToString() + "');", true);
                            return;
                        }
                    }
                    #endregion

                    //20120927_Claire增加E-MAIL卡關EmailCheck
                    #region E-MAIL格式卡關
                    if (!string.IsNullOrEmpty(strEmail))
                    {
                        string strMailCheck = objIssueOperate.EmailCheck(strEmail);
                        if (!string.IsNullOrEmpty(strMailCheck))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxEmailFormat"].ToString() + "');", true);

                            return;
                        }
                    }
                    #endregion
                }

                #region OutBoundRecord檢核
                //OutBoundRecord 資料未存在,新增OutBoundRecord資料并進行檢核
                if (string.IsNullOrEmpty(strOutBoundSn))
                {
                    //資料檢核 必填欄位
                    if (string.IsNullOrEmpty(strModelID))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrModel"].ToString() + "');", true);
                        return;
                    }
                    //選擇爲異常  Tech可爲空
                    if (!strException.Equals("Y"))
                    {
                        if (string.IsNullOrEmpty(strTech))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrTech"].ToString() + "');", true);
                            return;
                        }
                    }
                    if (string.IsNullOrEmpty(strTechQ))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrTechQ"].ToString() + "');", true);
                        return;
                    }
                    if (string.IsNullOrEmpty(strAnswer))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrAnswer"].ToString() + "');", true);
                        return;
                    }


                    //保留字符”|“輸入的檢核

                    if (Check_Helper.IsBadStr(strModelID))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxModelID"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strRmaNo))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxRmaNo"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strRelateID))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxRelateID"].ToString() + "');", true);
                        return;
                    }

                    if (Check_Helper.IsBadStr(strTechQ))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxTechQ"].ToString() + "');", true);
                        return;
                    }
                    if (Check_Helper.IsBadStr(strAnswer))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxAnswer"].ToString() + "');", true);
                        return;
                    }

                    //有點選了Test/Call close狀態不選為Y
                    if (!string.IsNullOrEmpty(strAction))
                    {
                        if (strClose.Equals("Y"))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxAction"].ToString() + "');", true);
                            return;
                        }
                    }
                    //2009/7/23加入資料來源不能爲空
                    if (string.IsNullOrEmpty(strSource))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrSource"].ToString() + "');", true);

                        return;
                    }
                    //GGTS/其它選項必塡資料
                    if (strSource.Equals("1") ||
                        strSource.Equals("6"))
                    {
                        if (string.IsNullOrEmpty(strSourceNote))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valrSourceNote"].ToString() + "');", true);

                            return;
                        }
                    }

                    //檢核相關的單號資料庫是否存在
                    if (!objIssueOperate.CheckRelateID(strRelateID))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxRelateID1"].ToString() + "');", true);

                        return;
                    }
                }
                #endregion

                //Alarm資料檢核

                if (Check_Helper.IsBadStr(strSubject))
                {
                    Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxSubject"].ToString() + "');", true);
                    return;
                }

                //如果輪入了TO/CC Email查詢Email是否正確
                if (!string.IsNullOrEmpty(strTO))
                {
                    if (strTO.IndexOf("@") > -1)
                    {
                        if (!Check_Helper.ValidateUserInput(strTO, 16))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxTo"].ToString() + "');", true);
                            return;
                        }
                    }
                    else
                    {
                        //判斷系統輸入的名字是否存在已系統中
                        string strTO1 = objIssueOperate.GetUserID(strTO);
                        if (string.IsNullOrEmpty(strTO1))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + strTO + " " + ViewState["valxTo1"].ToString() + "');", true);
                            return;
                        }
                        strTO = strTO1;
                    }
                }

                //查找塡入的To接收者資料是否已經存在
                strTO = CheckExist(strTO, strAttenTo);
                if (!string.IsNullOrEmpty(strCC))
                {
                    if (strCC.IndexOf("@") > -1)
                    {
                        if (!Check_Helper.ValidateUserInput(strCC, 16))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["valxCC"].ToString() + "');", true);
                            return;
                        }
                    }
                    else
                    {
                        //判斷系統輸入的名字是否存在已系統中
                        string strCC1 = objIssueOperate.GetUserID(strCC);
                        if (string.IsNullOrEmpty(strCC1))
                        {
                            Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + strCC + " " + ViewState["valxTo1"].ToString() + "');", true);
                            return;
                        }
                        strCC = strCC1;
                    }
                }
                strCC = CheckExist(strCC, strAttenCC);
                //新增時,自動紀錄CC欄位爲登錄帳號
                //有客到,默認CC 爲登錄帳號
                if (string.IsNullOrEmpty(strAlarmID))
                {
                    if (strAlarmType.Equals("G"))
                    {
                        if (strCC.IndexOf(Session["g_UserID"].ToString()) == -1)
                        {
                            if (string.IsNullOrEmpty(strCC))
                            {
                                strCC = Session["g_UserID"].ToString();
                            }
                            else
                            {
                                strCC += "," + Session["g_UserID"].ToString();
                            }
                        }
                    }
                }
                strCC = CheckExist(strCC, strAttenCC);
                #region 20120829_Claire增加收件人卡關:IS_LOGIN='******'才可發信
                //20120829_Claire增加收件人卡關:IS_LOGIN='******'才可發信
                if ((!string.IsNullOrEmpty(objOutBoundEntity.ATTEN_TO)) || (!string.IsNullOrEmpty(objOutBoundEntity.ATTEN_CC)))
                {
                    string strAddressee = objOutBoundOpe.CheckAddressee(objOutBoundEntity);
                    if (!string.IsNullOrEmpty(strAddressee))
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["AddresseeError"].ToString() + " : " + strAddressee + "');", true);
                        return;
                    }
                }
                #endregion


                #region 新增資料覆值

                objOutBoundEntity.OUTBOUND_ID           = strOutBoundID;
                objOutBoundEntity.TIME_COUNTING         = strTimeCountring;
                objOutBoundEntity.WEEK                  = strWeek;
                objOutBoundEntity.USER_ID               = strUserID;
                objOutBoundEntity.TEL_NUM_1             = strTel1;
                objOutBoundEntity.TEL_NUM_2             = strTel2;
                objOutBoundEntity.COUNTRY               = strCountry;
                objOutBoundEntity.CREATE_ID             = Session["g_UserID"].ToString().Trim();
                objOutBoundEntity.CUST_ID               = strUserID;
                objOutBoundEntity.CUST_INVOICE_ADDRESS  = strAddress2;
                objOutBoundEntity.CUST_SHIPPING_ADDRESS = strAddress1;
                objOutBoundEntity.SEX             = strSex;
                objOutBoundEntity.FOUTH_NUM       = str4Num;
                objOutBoundEntity.EMAIL           = strEmail;
                objOutBoundEntity.USER_TYPE       = strUserType;
                objOutBoundEntity.CUST_SHORT_NAME = strCustName;
                objOutBoundEntity.OUTBOUND_SN     = strOutBoundSn;
                objOutBoundEntity.PRODUCT_LINE    = strProductLine;
                objOutBoundEntity.MODEL_ID        = strModelID;

                objOutBoundEntity.ACTION       = strAction;
                objOutBoundEntity.TECH         = strTech;
                objOutBoundEntity.RMA_ORDER_NO = strRmaNo;
                objOutBoundEntity.EXCEPTION    = strException;
                objOutBoundEntity.CLOSE        = strClose;
                objOutBoundEntity.RELATE_ID    = strRelateID;

                objOutBoundEntity.CLASS_VALUE     = ((HtmlInputHidden)Page.FindControl("hidClassValue" + strIndex)).Value.Trim();
                objOutBoundEntity.PRODUCT_ID      = ((HtmlInputHidden)Page.FindControl("hidProductID" + strIndex)).Value.Trim();
                objOutBoundEntity.PRODUCT_VERSION = strProductVersion;
                objOutBoundEntity.IS_SUBMIT       = "N";
                objOutBoundEntity.SOURCE          = strSource;
                //記錄用點點擊開如新增時間
                objOutBoundEntity.ACTION_START_DATE = strStartTime;
                objOutBoundEntity.ACTION_END_DATE   = strEndTime;
                objOutBoundEntity.TECH_Q            = strTechQ;
                objOutBoundEntity.ANSWER            = strAnswer;
                objOutBoundEntity.SEQ         = strIndex;
                objOutBoundEntity.ALARM_DATE  = strDate;
                objOutBoundEntity.ALARM_TYPE  = strAlarmType;
                objOutBoundEntity.TYPE1       = strType1;
                objOutBoundEntity.TYPE2       = strType2;
                objOutBoundEntity.SOURCE_NOTE = strSourceNote;
                if (!string.IsNullOrEmpty(strCC))
                {
                    if (!string.IsNullOrEmpty(strAttenCC))
                    {
                        objOutBoundEntity.ATTEN_CC = strCC + "," + strAttenCC;
                    }
                    else
                    {
                        objOutBoundEntity.ATTEN_CC = strCC;
                    }
                }
                else
                {
                    objOutBoundEntity.ATTEN_CC = strAttenCC;
                }

                if (!string.IsNullOrEmpty(strTO))
                {
                    if (!string.IsNullOrEmpty(strAttenTo))
                    {
                        objOutBoundEntity.ATTEN_TO = strTO + "," + strAttenTo;
                    }
                    else
                    {
                        objOutBoundEntity.ATTEN_TO = strTO;
                    }
                }
                else
                {
                    objOutBoundEntity.ATTEN_TO = strAttenTo;
                }
                objOutBoundEntity.ALARM_ID = strAlarmID;
                objOutBoundEntity.SUBJECT  = strSubject;
                #endregion

                //strAlarmID 不爲空修改,否則爲新增
                if (string.IsNullOrEmpty(strAlarmID))
                {
                    string strOutBoundID1 = "";
                    string strUserID1     = "";
                    string strOutBoundSn1 = "";
                    string strAlarmID1    = "";


                    if (objOutBoundOpe.AddActionAlarm(objOutBoundEntity, out strOutBoundID1, out strUserID1, out strOutBoundSn1, out strAlarmID1, AddAlarm))
                    {
                        //模式切換的到只讀模式 hidAlarmStatus保存着是新增模式,還是修改模式 值爲ADD新增,MODIFY修改,空值爲只讀模式
                        HtmlInputHidden hidAlarmStatus = (HtmlInputHidden)Page.FindControl("hidAlarmStatus" + strIndex);
                        hidAlarmStatus.Value    = "";
                        this.txtOutBoundID.Text = strOutBoundID1;
                        this.hidUserID.Value    = strUserID1;
                        hidOutBoundSn.Value     = strOutBoundSn1;
                        hidAlarmID.Value        = strAlarmID1;

                        if (string.IsNullOrEmpty(strOutBoundSn))
                        {
                            SetOutBoundRecordStyle(strIndex);
                        }
                        strSubject = strSubject.Replace("【OUTBOUND_ID】", "【" + this.txtOutBoundID.Text + "】");

                        ((HtmlInputHidden)Page.FindControl("hidSelectedItem" + strIndex)).Value = strAlarmID1 + "|"
                                                                                                  + objOutBoundEntity.ALARM_DATE + "|" + objOutBoundEntity.ATTEN_TO
                                                                                                  + "|" + objIssueOperate.GetAttenName(objOutBoundEntity.ATTEN_TO) + "|" + objOutBoundEntity.ATTEN_CC +
                                                                                                  "|" + objIssueOperate.GetAttenName(objOutBoundEntity.ATTEN_CC) + "|" + strAlarmType + "|" + strSubject;
                        ((TextBox)Page.FindControl("txtSubject" + strIndex)).Text = strSubject;

                        //點選爲叫修/填寫叫修資料
                        if (radAlarmType.SelectedIndex == 3)
                        {
                            hidAlarmStatus.Value = "MODIFY";
                            Public_Helper.CallJavascriptEvent(this, "Open", "RePageStatus();OpenOutBoundRepair('" + strIndex + "','" + Check_Helper.ConvertFormat(ViewState["vsAgentID"].ToString(), 3) + "','" + Check_Helper.ConvertFormat(strAlarmID1, 3) + "');", true);
                        }
                        else
                        {
                            //有客到
                            if (radAlarmType.SelectedIndex == 4)
                            {
                                //2012-01-31 同步Issue
                                Session["UserTel"] = "";
                                Session["UserTel"] = this.txtTel1.Text.ToString().Trim();

                                //Public_Helper.CallJavascriptEvent(this, "Open", "RePageStatus();OpenOutBoundGuest('" + strIndex + "','" + Check_Helper.ConvertFormat(ViewState["vsAgentID"].ToString(), 3) + "','" + Check_Helper.ConvertFormat(strAlarmID1, 3) + "');", true);
                                Public_Helper.CallJavascriptEvent(this, "Open", "RePageStatus();OpenOutBoundGuest('" + strIndex + "','" + Check_Helper.ConvertFormat(ViewState["vsAgentID"].ToString(), 3) + "','" + Check_Helper.ConvertFormat(strAlarmID1, 3) + "','" + Check_Helper.ConvertFormat(strUserInfo, 3) + "');", true);
                            }
                            else
                            {
                                Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["AddHeaderSuccess"].ToString() + "');", true);
                            }
                        }

                        //信息Html顯示
                        switch (strIndex)
                        {
                        case "1":
                            divTechQ1.InnerHtml  = objOutBoundEntity.TECH_Q;
                            divAnswer1.InnerHtml = objOutBoundEntity.ANSWER;
                            break;

                        case "2":
                            divTechQ2.InnerHtml  = objOutBoundEntity.TECH_Q;
                            divAnswer2.InnerHtml = objOutBoundEntity.ANSWER;
                            break;

                        case "3":
                            divTechQ3.InnerHtml  = objOutBoundEntity.TECH_Q;
                            divAnswer3.InnerHtml = objOutBoundEntity.ANSWER;
                            break;

                        case "4":
                            divTechQ4.InnerHtml  = objOutBoundEntity.TECH_Q;
                            divAnswer4.InnerHtml = objOutBoundEntity.ANSWER;
                            break;

                        case "5":
                            divTechQ5.InnerHtml  = objOutBoundEntity.TECH_Q;
                            divAnswer5.InnerHtml = objOutBoundEntity.ANSWER;
                            break;
                        }
                    }
                    else
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["AddHeaderFailure"].ToString() + "');", true);
                        return;
                    }
                }
                else
                {
                    if (objOutBoundOpe.ModifyActionAlarm(objOutBoundEntity))
                    {
                        //模式切換的到只讀模式 hidAlarmStatus保存着是新增模式,還是修改模式 值爲ADD新增,MODIFY修改,空值爲只讀模式
                        HtmlInputHidden hidAlarmStatus = (HtmlInputHidden)Page.FindControl("hidAlarmStatus" + strIndex);
                        hidAlarmStatus.Value = "";

                        //取得新增時AlarmType狀態
                        string   strSelectedItem = ((HtmlInputHidden)Page.FindControl("hidSelectedItem" + strIndex)).Value;
                        string[] arrSelectedItem = strSelectedItem.Split('|');
                        //arrSelectedItem[6]爲AlarmType
                        ((HtmlInputHidden)Page.FindControl("hidSelectedItem" + strIndex)).Value = strAlarmID + "|"
                                                                                                  + objOutBoundEntity.ALARM_DATE + "|" + objOutBoundEntity.ATTEN_TO
                                                                                                  + "|" + objIssueOperate.GetAttenName(objOutBoundEntity.ATTEN_TO) + "|" + objOutBoundEntity.ATTEN_CC +
                                                                                                  "|" + objIssueOperate.GetAttenName(objOutBoundEntity.ATTEN_CC) + "|" + arrSelectedItem[6] + "|" + strSubject;

                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["ModifyHeaderSuccess"].ToString() + "');", true);
                    }
                    else
                    {
                        Public_Helper.CallJavascriptEvent(this, "alert", "PrivateAlertMsg('" + ViewState["ModifyHeaderFailure"].ToString() + "');", true);
                        return;
                    }
                }



                ViewState["vsLoadStatus"] = "1";
                ((TextBox)Page.FindControl("txtTo" + strIndex)).Text = "";
                ((TextBox)Page.FindControl("txtCC" + strIndex)).Text = "";
                App_WebForm_Web_Common_SmartPageControl objSmartPageCountrol = (App_WebForm_Web_Common_SmartPageControl)Page.FindControl("objPageControlAlarm" + strIndex);
                objSmartPageCountrol.BindData1();
            }
            catch (Exception Exp)
            {
                throw new Exception(Exp.Message);
            }
        }
        protected override void AttachChildControls()
        {
            this.orderId = this.Page.Request.QueryString["orderId"];
            InsuranceOrderInfo info = dao.GetModel(Convert.ToInt32(this.orderId));
            decimal            num  = 0M;
            decimal            num2 = 0M;

            num = info.InsuranceOrderAmount.Value;

            if (info == null)
            {
                this.Page.Response.Redirect("/Vshop/MemberInsuranceOrders.aspx");
            }
            bool flag = true;

            if (info.InsuranceOrderStatu != 2)
            {
                HttpContext.Current.Response.Write("<script>alert('未报价订单无法支付!');location.href='/Vshop/MemberInsuranceOrders.aspx'</script>");
                HttpContext.Current.Response.End();
            }

            string gateway = "hishop.plugins.payment.weixinrequest";

            int PaymentTypeId = 88;


            this.Page.Request.Url.ToString().ToLower();
            int    num3      = Globals.RequestQueryNum("IsAlipay");
            string userAgent = this.Page.Request.UserAgent;

            if (((num3 == 1) || !userAgent.ToLower().Contains("micromessenger")) || (string.IsNullOrEmpty(gateway) || !(gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest")))
            {
                if (!string.IsNullOrEmpty(gateway) && (gateway == "hishop.plugins.payment.offlinerequest"))
                {
                    this.litMessage = (Literal)this.FindControl("litMessage");
                    this.litMessage.SetWhenIsNotNull(SettingsManager.GetMasterSettings(false).OffLinePayContent);
                }
                this.litOPertorList      = (Literal)this.FindControl("litOPertorList");
                this.litOPertorList.Text = "<div class=\"btns mt20\"><a id=\"linkToDetail\" class=\"btn btn-default mr10\" role=\"button\">查看订单</a><a href=\"/Default.aspx\" class=\"btn btn-default\" role=\"button\">继续逛逛</a></div>";
                if (!string.IsNullOrEmpty(gateway) && (gateway == "hishop.plugins.payment.weixinrequest"))
                {
                    string str2 = "立即支付";
                    if ((num2 > 0M) && ((num - num2) > 0M))
                    {
                        str2 = "还需支付 " + ((num - num2)).ToString("F2");
                    }
                    this.litOPertorList.Text = "<div class=\"mt20\"><a href=\"/pay/wx_Submit.aspx?orderId=" + this.orderId + "\" class=\"btn btn-danger\" role=\"button\" id=\"btnToPay\">" + str2 + "</a></div>";
                }
                if (((!string.IsNullOrEmpty(gateway) && (gateway != "hishop.plugins.payment.podrequest")) && ((gateway != "hishop.plugins.payment.offlinerequest") && (gateway != "hishop.plugins.payment.weixinrequest"))) && (((gateway != "hishop.plugins.payment.balancepayrequest") && (gateway != "hishop.plugins.payment.pointtocach")) && (gateway != "hishop.plugins.payment.coupontocach")))
                {
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(PaymentTypeId);
                    string          attach      = "";
                    string          showUrl     = string.Format("http://{0}/vshop/", HttpContext.Current.Request.Url.Host);
                    PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), this.orderId, num - num2, "订单支付", "订单号-" + this.orderId, "*****@*****.**", info.InsuranceOrderCreatDate.Value, showUrl, Globals.FullPath("/pay/PaymentReturn_url.aspx"), Globals.FullPath("/pay/PaymentNotify_url.aspx"), attach).SendRequest();
                }
                else
                {
                    this.litOrderId            = (Literal)this.FindControl("litOrderId");
                    this.litOrderTotal         = (Literal)this.FindControl("litOrderTotal");
                    this.literalOrderTotal     = (Literal)this.FindControl("literalOrderTotal");
                    this.literalBalancePayInfo = (Literal)this.FindControl("literalBalancePayInfo");
                    this.litPaymentType        = (HtmlInputHidden)this.FindControl("litPaymentType");
                    int result = 0;
                    this.litPaymentType.SetWhenIsNotNull("0");
                    if (int.TryParse(this.Page.Request.QueryString["PaymentType"], out result))
                    {
                        this.litPaymentType.SetWhenIsNotNull(result.ToString());
                    }
                    this.litOrderId.SetWhenIsNotNull(this.orderId);
                    if (flag)
                    {
                        this.litOrderTotal.SetWhenIsNotNull("您需要支付:\x00a5" + num.ToString("F2"));
                    }
                    this.literalOrderTotal.SetWhenIsNotNull("订单金额:<span style='color:red'>\x00a5" + num.ToString("F2") + "</span>");
                    if (num2 > 0M)
                    {
                        this.literalBalancePayInfo.Text = "<div class='font-xl'>余额已支付:<span style='color:red'>\x00a5" + num2.ToString("F2") + "</span></div>";
                    }
                    this.litHelperText = (Literal)this.FindControl("litHelperText");
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent);
                    PageTitle.AddSiteNameTitle("下单成功");
                }
            }
            else
            {
                this.Page.Response.Redirect("/Pay/IframeAlipay.aspx?OrderId=" + this.orderId);
            }
        }
 protected override void AttachChildControls()
 {
     this.inputPaymentModeId      = (HtmlInputHidden)this.FindControl("inputPaymentModeId");
     this.inputShippingModeId     = (HtmlInputHidden)this.FindControl("inputShippingModeId");
     this.hidPaymentId_Podrequest = (HtmlInputHidden)this.FindControl("hidPaymentId_Podrequest");
     this.hidPaymentId_Offline    = (HtmlInputHidden)this.FindControl("hidPaymentId_Offline");
     this.hidGetgoodsOnStores     = (HtmlInputHidden)this.FindControl("hidGetgoodsOnStores");
     this.hidHasStoresInCity      = (HtmlInputHidden)this.FindControl("hidHasStoresInCity");
     this.hidDeliveryTime         = (HtmlInputHidden)this.FindControl("hidDeliveryTime");
     this.hidStoreId            = (HtmlInputHidden)this.FindControl("hidStoreId");
     this.hidShipAddressId      = (HtmlInputHidden)this.FindControl("hidShipAddressId");
     this.litStoreName          = (Literal)this.FindControl("litStoreName");
     this.litAddress            = (Literal)this.FindControl("litAddress");
     this.litTel                = (Literal)this.FindControl("litTel");
     this.hidOnlinePayCount     = (HtmlInputHidden)this.FindControl("hidOnlinePayCount");
     this.hidHasSupplierProduct = (HtmlInputHidden)this.FindControl("hidHasSupplierProduct");
     if (!this.Page.IsPostBack)
     {
         this.hidHasSupplierProduct.Value   = this.hasSupplierProduct.ToString();
         this.hidOnlinePayCount.Value       = TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup).ToNullString();
         this.hidGetgoodsOnStores.Value     = "false";
         this.hidHasStoresInCity.Value      = "false";
         this.hidPaymentId_Podrequest.Value = "0";
         int num  = 0;
         int num2 = 0;
         if (this.from != "countdown" && this.from != "groupbuy" && this.hasSupplierProduct != 1)
         {
             if (this.from != "presale" && SalesHelper.IsSupportPodrequest())
             {
                 num = 1;
                 this.hidPaymentId_Podrequest.Value = "1";
             }
             if (ShoppingProcessor.IsSupportOfflineRequest())
             {
                 this.hidPaymentId_Offline.Value = "2";
                 num2 = 2;
             }
         }
         if (this.paymentModeId != 0 && this.paymentModeId != num && this.paymentModeId != num2 && this.paymentModeId != -3)
         {
             this.paymentModeId = 0;
         }
         this.hidDeliveryTime.Value = this.deliveryTime;
         if (this.paymentModeId == 0)
         {
             if (TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup) > 0)
             {
                 this.inputPaymentModeId.Value = this.paymentModeId.ToString();
             }
         }
         else
         {
             this.inputPaymentModeId.Value = this.paymentModeId.ToString();
         }
         this.inputShippingModeId.Value = this.shippingModeId.ToString();
         int shipAddressId = 0;
         int.TryParse(this.Page.Request.QueryString["ShipAddressId"].ToNullString(), out shipAddressId);
         IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses(false);
         int regionId = 0;
         IList <ShippingAddressInfo> list = new List <ShippingAddressInfo>();
         ShippingAddressInfo         shippingAddressInfo = null;
         if (shipAddressId > 0)
         {
             shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo a) => a.ShippingId == shipAddressId);
             if (shippingAddressInfo != null)
             {
                 regionId = shippingAddressInfo.RegionId;
             }
         }
         else if (shippingAddresses != null && shippingAddresses.Count > 0)
         {
             regionId = shippingAddresses.FirstOrDefault().RegionId;
         }
         this.hidShipAddressId.Value = shipAddressId.ToString();
         SiteSettings masterSettings = SettingsManager.GetMasterSettings();
         if (masterSettings.OpenMultStore)
         {
             this.hidStoreId.Value = this.storeId.ToString();
             if (this.storeId > 0)
             {
                 StoresInfo storeById = DepotHelper.GetStoreById(this.storeId);
                 this.litStoreName.Text = (string.IsNullOrEmpty(storeById.StoreOpenTime) ? storeById.StoreName : (storeById.StoreName + " [营业时间:" + storeById.StoreOpenTime + "]"));
                 this.litAddress.Text   = RegionHelper.GetFullRegion(storeById.RegionId, string.Empty, true, 0) + storeById.Address;
                 this.litTel.Text       = storeById.Tel;
             }
             if (this.from != "countdown" && this.from != "groupbuy" && this.from != "presale" && this.shoppingCart.LineItems.Count > 0)
             {
                 string str = this.productSku.Replace(",", "','");
                 str = "'" + str + "'";
                 if (ShoppingCartProcessor.CanGetGoodsOnStore(str))
                 {
                     this.hidGetgoodsOnStores.Value = "true";
                     bool flag = StoresHelper.HasStoresInCity(str, regionId);
                     this.hidHasStoresInCity.Value = (flag ? "true" : "false");
                 }
             }
             else
             {
                 this.hidGetgoodsOnStores.Value = "false";
             }
         }
     }
 }
        /// <summary>
        /// 设置页面控件的值
        /// </summary>
        /// <param name="page"></param>
        /// <param name="ht"></param>
        public static void SetWebControls(Control page, Hashtable ht)
        {
            if (ht.Count != 0)
            {
                int size = ht.Keys.Count;
                foreach (string key in ht.Keys)
                {
                    object val = ht[key];
                    if (val != null)
                    {
                        Control control   = page.FindControl("txt" + key);
                        Control hiddenCtr = page.FindControl("h" + key);
                        //var s = control.NamingContainer;

                        #region hidden input

                        if (hiddenCtr != null)
                        {
                            HtmlInputHidden hInput = (HtmlInputHidden)hiddenCtr;
                            if (hInput != null)
                            {
                                hInput.Value = val.ToString().Trim();
                            }
                        }

                        #endregion hidden input

                        #region normal control

                        if (control == null)
                        {
                            continue;
                        }
                        if (control is HtmlGenericControl)
                        {
                            HtmlGenericControl txt = (HtmlGenericControl)control;
                            txt.InnerHtml = val.ToString().Trim();
                        }
                        if (control is HtmlInputText)
                        {
                            HtmlInputText txt = (HtmlInputText)control;
                            txt.Value = val.ToString().Trim();
                        }
                        if (control is TextBox)
                        {
                            TextBox txt = (TextBox)control;
                            txt.Text = val.ToString().Trim();
                        }
                        if (control is HtmlSelect)
                        {
                            HtmlSelect txt = (HtmlSelect)control;

                            if (val.ToString().Trim().ToUpper() == "TRUE" ||
                                val.ToString().Trim().ToUpper() == "FALSE")
                            {
                                txt.Value = ((val.ToString().Trim().ToUpper() == "TRUE") ? "1" : "0");
                            }
                            else
                            {
                                txt.Value = val.ToString().Trim();
                            }
                        }
                        if (control is HtmlInputHidden)
                        {
                            HtmlInputHidden txt = (HtmlInputHidden)control;
                            txt.Value = val.ToString().Trim();
                        }
                        if (control is HtmlInputPassword)
                        {
                            HtmlInputPassword txt = (HtmlInputPassword)control;
                            txt.Value = val.ToString().Trim();
                        }
                        if (control is Label)
                        {
                            Label txt = (Label)control;
                            txt.Text = val.ToString().Trim();
                        }
                        if (control is HtmlInputCheckBox)
                        {
                            HtmlInputCheckBox chk = (HtmlInputCheckBox)control;
                            chk.Checked = val.ToSafeInt32(0) == 1 ? true : false;
                        }
                        if (control is HtmlTextArea)
                        {
                            HtmlTextArea area = (HtmlTextArea)control;
                            area.Value = val.ToString().Trim();
                        }
                        if (control is DropDownList)
                        {
                            DropDownList drp = (DropDownList)control;
                            drp.SelectedValue = val.ToString().Trim();
                        }

                        #endregion normal control
                    }
                }
            }
        }
 public HiddenMatchSearchBinder(HtmlInputHidden c, string name)
     : this(c, name, "=")
 {
 }
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (!int.TryParse(this.Page.Request.QueryString["PreSaleId"], out this.presaleId))
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.presaleId);

            if (productPreSaleInfo == null)
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            if (productPreSaleInfo.PreSaleEndDate < DateTime.Now)
            {
                this.Page.Response.Redirect("ProductDetails.aspx?ProductId = " + productPreSaleInfo.ProductId);
                return;
            }
            this.productId               = productPreSaleInfo.ProductId;
            this.hidSupplier             = (HtmlInputHidden)this.FindControl("hidSupplier");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations");
            this.rptProductImages        = (WapTemplatedRepeater)this.FindControl("rptProductImages");
            this.rptCouponList           = (WapTemplatedRepeater)this.FindControl("rptCouponList");
            this.rp_guest                = (WapTemplatedRepeater)this.FindControl("rp_guest");
            this.rp_com                  = (WapTemplatedRepeater)this.FindControl("rp_com");
            this.litProdcutName          = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.ltlcombinamaininfo      = (Literal)this.FindControl("ltlcombinamaininfo");
            this.skuSubmitOrder          = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder");
            this.expandAttr              = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount            = (Literal)this.FindControl("litSoldCount");
            this.litConsultationsCount   = (Literal)this.FindControl("litConsultationsCount");
            this.litReviewsCount         = (Literal)this.FindControl("litReviewsCount");
            this.litHasCollected         = (HtmlInputHidden)this.FindControl("litHasCollected");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.ltlOrderPromotion2      = (Literal)this.FindControl("ltlOrderPromotion2");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.ltlProductSendGifts2    = (Literal)this.FindControl("ltlProductSendGifts2");
            this.liOrderPromotions       = (HtmlGenericControl)this.FindControl("liOrderPromotions");
            this.liOrderPromotions2      = (HtmlGenericControl)this.FindControl("liOrderPromotions2");
            this.liProductSendGifts      = (HtmlGenericControl)this.FindControl("liProductSendGifts");
            this.liProductSendGifts2     = (HtmlGenericControl)this.FindControl("liProductSendGifts2");
            this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2");
            this.liOrderPromotions_free  = (HtmlGenericControl)this.FindControl("liOrderPromotions_free");
            this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.divshiptoregion         = (HtmlGenericControl)this.FindControl("divshiptoregion");
            this.divwaplocateaddress     = (HtmlGenericControl)this.FindControl("divwaplocateaddress");
            this.productFreight          = (ProductFreightLiteral)this.FindControl("productFreight");
            this.promote                 = (ProductPromote)this.FindControl("ProductPromote");
            this.hdAppId                 = (HtmlInputHidden)this.FindControl("hdAppId");
            this.hdTitle                 = (HtmlInputHidden)this.FindControl("hdTitle");
            this.hdDesc                  = (HtmlInputHidden)this.FindControl("hdDesc");
            this.hdImgUrl                = (HtmlInputHidden)this.FindControl("hdImgUrl");
            this.hdLink                  = (HtmlInputHidden)this.FindControl("hdLink");
            this.hidCombinaid            = (HtmlInputHidden)this.FindControl("hidCombinaid");
            this.divConsultationEmpty    = (HtmlGenericControl)this.FindControl("divConsultationEmpty");
            this.ulConsultations         = (HtmlGenericControl)this.FindControl("ulConsultations");
            this.divShortDescription     = (HtmlGenericControl)this.FindControl("divShortDescription");
            this.hidRegionId             = (HtmlInputHidden)this.FindControl("hidRegionId");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidCouponCount          = (HtmlInputHidden)this.FindControl("hidCouponCount");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divPodrequest           = (HtmlGenericControl)this.FindControl("divPodrequest");
            this.divGuest                = (HtmlGenericControl)this.FindControl("divGuest");
            this.divcombina              = (HtmlGenericControl)this.FindControl("divcombina");
            this.hidUnOnSale             = (HtmlInputHidden)this.FindControl("hidUnOnSale");
            this.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litpresaleprice         = (Literal)this.FindControl("litpresaleprice");
            this.litsaleprice            = (Literal)this.FindControl("litsaleprice");
            this.litRetainage            = (Literal)this.FindControl("litRetainage");
            this.litDeliverGood          = (Literal)this.FindControl("litDeliverGood");
            this.hidEndDate              = (HtmlInputHidden)this.FindControl("hidEndDate");
            this.hidNowDate              = (HtmlInputHidden)this.FindControl("hidNowDate");
            this.hdAppId.Value           = masterSettings.WeixinAppId;
            HtmlInputHidden htmlInputHidden = this.hidRegionId;
            int             num             = HiContext.Current.DeliveryScopRegionId;

            htmlInputHidden.Value = num.ToString();
            this.hidden_skuItem   = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidCartQuantity  = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.lblStock         = (StockLabel)this.FindControl("lblStock");
            this.litUnit          = (Literal)this.FindControl("litUnit");
            ProductBrowseInfo productPreSaleBrowseInfo = ProductBrowser.GetProductPreSaleBrowseInfo(this.productId, true);

            if (productPreSaleBrowseInfo.Product == null || productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("ProductDelete.aspx");
                return;
            }
            if (productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
            {
                this.hidUnOnSale.Value = "1";
            }
            this.litpresaleprice.Text = ((productPreSaleInfo.DepositPercent == 0) ? productPreSaleInfo.Deposit.F2ToString("f2") : ((decimal)productPreSaleInfo.DepositPercent * productPreSaleBrowseInfo.Product.MinSalePrice / 100m).F2ToString("f2"));
            if (productPreSaleBrowseInfo.Product.MinSalePrice < productPreSaleBrowseInfo.Product.MaxSalePrice)
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~ ¥" + productPreSaleBrowseInfo.Product.MaxSalePrice.F2ToString("f2");
            }
            else
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2");
            }
            Literal  literal  = this.litRetainage;
            DateTime dateTime = productPreSaleInfo.PaymentStartDate;
            string   str      = dateTime.ToString("yyyy/MM/dd");

            dateTime     = productPreSaleInfo.PaymentEndDate;
            literal.Text = str + "~" + dateTime.ToString("yyyy/MM/dd");
            Literal literal2 = this.litDeliverGood;
            object  text;

            if (!productPreSaleInfo.DeliveryDate.HasValue)
            {
                text = $"尾款支付后{productPreSaleInfo.DeliveryDays}天内发货";
            }
            else
            {
                dateTime = productPreSaleInfo.DeliveryDate.Value;
                text     = dateTime.ToString("yyyy年MM月dd日") + "发货";
            }
            literal2.Text = (string)text;
            HtmlInputHidden htmlInputHidden2 = this.hidNowDate;

            dateTime = DateTime.Now;
            htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            HtmlInputHidden htmlInputHidden3 = this.hidEndDate;

            dateTime = productPreSaleInfo.PreSaleEndDate;
            htmlInputHidden3.Value                 = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            this.skuSubmitOrder.ProductInfo        = productPreSaleBrowseInfo.Product;
            this.skuSubmitOrder.OrderBusiness      = 4;
            this.skuSubmitOrder.PreSaleId          = this.presaleId;
            this.skuSubmitOrder.productPreSaleInfo = productPreSaleInfo;
            this.lbUserProductRefer.product        = productPreSaleBrowseInfo.Product;
            this.productFreight.ShippingTemplateId = productPreSaleBrowseInfo.Product.ShippingTemplateId;
            this.productFreight.Volume             = productPreSaleBrowseInfo.Product.Weight;
            this.productFreight.Weight             = productPreSaleBrowseInfo.Product.Weight;
            this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.Title) ? productPreSaleBrowseInfo.Product.ProductName : productPreSaleBrowseInfo.Product.Title);
            this.hdDesc.Value  = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : productPreSaleBrowseInfo.Product.ShortDescription);
            string local = string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : productPreSaleBrowseInfo.Product.ImageUrl1;

            this.hdImgUrl.Value = Globals.FullPath(local);
            this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
            IEnumerable enumerable = from item in productPreSaleBrowseInfo.Product.Skus
                                     select item.Value;

            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId);
            }
            IEnumerable value = from item in productPreSaleBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            if (this.hidden_productId != null)
            {
                this.hidden_productId.Value = this.productId.ToString();
            }
            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            int supplierId = productPreSaleBrowseInfo.Product.SupplierId;

            if (supplierId > 0)
            {
                SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                if (supplierById != null)
                {
                    this.hidSupplier.Value    = "true";
                    this.litSupplierName.Text = supplierById.SupplierName;
                }
            }
            else
            {
                this.hidSupplier.Value = "false";
            }
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
                decimal?subMemberDeduct = productPreSaleBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
            }
            goto IL_0c89;
IL_0c89:
            int num2 = 1;

            goto IL_0c8a;
IL_0c8a:
            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            if (this.rptProductImages != null)
            {
                string locationUrl = "javascript:;";
                if (string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl5))
                {
                    productPreSaleBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage;
                }
                List <SlideImage> list = new List <SlideImage>();
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl1, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl2, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl3, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl4, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl5, locationUrl));
                this.rptProductImages.DataSource = from item in list
                                                   where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                   select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text         = productPreSaleBrowseInfo.Product.ProductName;
            this.litShortDescription.Text    = productPreSaleBrowseInfo.Product.ShortDescription;
            this.divShortDescription.Visible = !string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription);
            if (this.litDescription != null)
            {
                string text2 = "";
                Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.MobbileDescription))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.MobbileDescription, "");
                }
                else if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.Description))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.Description, "");
                }
                text2 = text2.Replace("src", "data-url");
                this.litDescription.Text = text2;
            }
            Literal control = this.litSoldCount;

            num = productPreSaleBrowseInfo.Product.ShowSaleCounts;
            control.SetWhenIsNotNull(num.ToString());
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            Literal control2 = this.litConsultationsCount;

            num = productPreSaleBrowseInfo.ConsultationCount;
            control2.SetWhenIsNotNull(num.ToString());
            Literal control3 = this.litReviewsCount;

            num = productPreSaleBrowseInfo.ReviewCount;
            control3.SetWhenIsNotNull(num.ToString());
            MemberInfo user2 = HiContext.Current.User;
            bool       flag  = false;

            if (user2 != null)
            {
                flag = ProductBrowser.CheckHasCollect(user2.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
            this.BindCouponList();
            PageTitle.AddSiteNameTitle(productPreSaleBrowseInfo.Product.ProductName);
            this.BindPromotionInfo();
            this.BindGuestProducts();
            DataTable dBConsultations = productPreSaleBrowseInfo.DBConsultations;

            for (int i = 0; i < dBConsultations.Rows.Count; i++)
            {
                dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString());
            }
            this.rptProductConsultations.DataSource = dBConsultations;
            this.rptProductConsultations.DataBind();
            this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty();
            this.ulConsultations.Visible      = !dBConsultations.IsNullOrEmpty();
            return;

IL_0c63:
            if (HiContext.Current.SiteSettings.OpenReferral == 1)
            {
                num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0);
                goto IL_0c8a;
            }
            goto IL_0c89;
        }
Пример #32
0
        protected override void AttachChildControls()
        {
            string s    = HttpContext.Current.Request.QueryString.Get("m");
            string str2 = HttpContext.Current.Request.QueryString.Get("type");

            this.ltGetTotal                      = (Literal)this.FindControl("ltGetTotal");
            this.ltOrderAmountCanUse             = (Literal)this.FindControl("ltOrderAmountCanUse");
            this.ltExpiryTime                    = (Literal)this.FindControl("ltExpiryTime");
            this.ltRedPagerActivityName          = (Literal)this.FindControl("ltRedPagerActivityName");
            this.ltRedPagerActivityNameForOrders = (Literal)this.FindControl("ltRedPagerActivityNameForOrders");
            this.ltRedPagerLimit                 = (Literal)this.FindControl("ltRedPagerLimit");
            this.ltErrorMessage                  = (Literal)this.FindControl("ltErrorMessage");
            this.divNoLogin                      = (Panel)this.FindControl("divNoLogin");
            this.divNoNum    = (Panel)this.FindControl("divNoNum");
            this.divSuccess  = (Panel)this.FindControl("divSuccess");
            this.divError    = (Panel)this.FindControl("divError");
            this.hdCondition = (HtmlInputHidden)this.FindControl("hdCondition");
            this.hlinkLogin  = (HyperLink)this.FindControl("hlinkLogin");
            switch (str2)
            {
            case "1":
            case "5":
            {
                int result = 0;
                int.TryParse(s, out result);
                if (result > 0)
                {
                    int num2 = 0;
                    int.TryParse(HttpContext.Current.Request["id"], out num2);
                    ShareActivityInfo act = ShareActHelper.GetAct(num2);
                    if (act != null)
                    {
                        CouponInfo coupon = CouponHelper.GetCoupon(act.CouponId);
                        this.ltGetTotal.Text          = coupon.CouponValue.ToString("F2").Replace(".00", "");
                        this.ltOrderAmountCanUse.Text = coupon.ConditionValue.ToString("F2").Replace(".00", "");
                        this.hdCondition.SetWhenIsNotNull(coupon.ConditionValue.ToString("F2").Replace(".00", ""));
                        this.ltExpiryTime.Text = coupon.EndDate.ToString("yyyy-MM-dd");
                        if (str2 == "5")
                        {
                            this.ltRedPagerActivityName.Text = "该券已经到你的钱包了</div><div class='get-red-explain'><a href='/Vshop/MyCouponLists.aspx'>点击查看</a>";
                        }
                        else
                        {
                            this.ltRedPagerActivityName.Text = coupon.CouponName ?? "";
                        }
                        if (coupon.IsAllProduct)
                        {
                            this.ltRedPagerLimit.Text = "该券可用于任意商品的抵扣";
                        }
                        else
                        {
                            string couponProductIds = CouponHelper.GetCouponProductIds(act.CouponId);
                            this.ltRedPagerLimit.Text = "该券可用于部分商品的抵扣</div><div class='get-red-explain'><a href='/ProductList.aspx?pIds='" + couponProductIds + ">查看商品</a>";
                        }
                        this.divSuccess.Visible = true;
                    }
                }
                PageTitle.AddSiteNameTitle("成功获取优惠券");
                return;
            }

            default:
            {
                string str5 = str2;
                if (str5 != null)
                {
                    if (!(str5 == "-1"))
                    {
                        if (str5 == "-2")
                        {
                            this.ltErrorMessage.Text = s;
                            this.divError.Visible    = true;
                            break;
                        }
                        if (str5 == "-4")
                        {
                            this.divNoLogin.Visible = true;
                            break;
                        }
                        if (str5 == "-3")
                        {
                            this.divNoNum.Visible = true;
                            break;
                        }
                    }
                    else
                    {
                        int num3 = 0;
                        int.TryParse(HttpContext.Current.Request["id"], out num3);
                        ShareActivityInfo info3 = ShareActHelper.GetAct(num3);
                        if (info3 != null)
                        {
                            CouponInfo info4 = CouponHelper.GetCoupon(info3.CouponId);
                            if (info4 != null)
                            {
                                this.ltRedPagerActivityNameForOrders.Text = info4.CouponName;
                                string str4 = string.Concat(new object[] { Globals.GetWebUrlStart(), "/Vshop/GetRedPager.aspx?id=", num3.ToString(), "&userid=", Globals.GetCurrentMemberUserId(false), "&ReferralId=", Globals.GetCurrentDistributorId() });
                                this.hlinkLogin.NavigateUrl = "/UserLogining.aspx?returnUrl=" + HttpContext.Current.Server.UrlEncode(str4);
                                this.divNoLogin.Visible     = true;
                            }
                            else
                            {
                                HttpContext.Current.Response.Redirect("/default.aspx");
                                HttpContext.Current.Response.End();
                            }
                        }
                        else
                        {
                            HttpContext.Current.Response.Redirect("/default.aspx");
                            HttpContext.Current.Response.End();
                        }
                    }
                }
                break;
            }
            }
            PageTitle.AddSiteNameTitle("获取优惠券");
        }
Пример #33
0
        protected void SaveChanges(object sender, System.EventArgs e)
        {
            oDBLookup = new DBLookup(Master.SqlConn);
            int    nSubjConsentID        = Convert.ToInt32(hidSubjConsentID.Value);
            int    nSubjID               = oDBLookup.GetSubjectIDFromSubjConsentID(nSubjConsentID);
            int    nConsentFormVersionID = oDBLookup.GetConsentFormVersionIDBySubjConsentID(nSubjConsentID);
            string sConsentItemIDs       = "";

            if (Request["chkConsentItemIDs"] != null)
            {
                sConsentItemIDs = Request["chkConsentItemIDs"].ToString();
            }

            SqlCommand oCmd = new SqlCommand();

            oCmd.Connection     = Master.SqlConn;
            oCmd.CommandTimeout = 90;
            oCmd.CommandType    = CommandType.StoredProcedure;
            oCmd.CommandText    = "spUpdateConsentForm";

            oCmd.Parameters.AddWithValue("@SubjConsentID", nSubjConsentID);
            oCmd.Parameters.AddWithValue("@DateSigned", txtDateSigned.Text);
            oCmd.Parameters.AddWithValue("@TimeSigned", txtTimeSigned.Text);
            oCmd.Parameters.AddWithValue("@ConsentStatusID", selConsentFormStatusID.SelectedValue);
            oCmd.Parameters.AddWithValue("@ConsentFormVersionID", selConsentFormVersionID.SelectedValue);
            oCmd.Parameters.AddWithValue("@Notes", txtNotes.Text);
            oCmd.Parameters.AddWithValue("@UpdateVersion", true);

            if (oCmd.Parameters["@DateSigned"].Value.ToString() == "")
            {
                oCmd.Parameters["@DateSigned"].Value = DBNull.Value;
            }
            if (oCmd.Parameters["@ConsentFormVersionID"].Value.ToString() == "" || oCmd.Parameters["@ConsentFormVersionID"].Value.ToString() == "-1")
            {
                oCmd.Parameters["@ConsentFormVersionID"].Value = DBNull.Value;
            }
            if (oCmd.Parameters["@Notes"].Value.ToString() == "")
            {
                oCmd.Parameters["@Notes"].Value = DBNull.Value;
            }

            oCmd.ExecuteNonQuery();

            #region Loop over consent items and save

            foreach (RepeaterItem ri in rpConsentItems.Items)
            {
                DropDownList    ddl   = (DropDownList)ri.FindControl("ddlConsentItem");
                TextBox         d     = (TextBox)ri.FindControl("txtItemDateSigned");
                TextBox         t     = (TextBox)ri.FindControl("txtItemTimeSigned");
                TextBox         n     = (TextBox)ri.FindControl("txtSubjConsentItemNotes");
                HtmlInputHidden ht    = (HtmlInputHidden)ri.FindControl("txtSubjConsentItemID");
                DateTime        convd = new DateTime();

                oCmd.Parameters.Clear();
                oCmd.CommandType = CommandType.Text;
                oCmd.CommandText = "update tblSubjConsentItem " +
                                   "set ConsentItemOptionID = @ConsentItemOptionID, ItemDateSigned = @ItemDateSigned, " +
                                   "ItemTimeSigned = @ItemTimeSigned, SubjConsentItemNotes = @SubjConsentItemNotes " +
                                   "where SubjConsentItemID = @SubjConsentItemID";

                if (DateTime.TryParse(d.Text, out convd))
                {
                    oCmd.Parameters.AddWithValue("@ItemDateSigned", convd);
                }
                else
                {
                    oCmd.Parameters.AddWithValue("@ItemDateSigned", DBNull.Value);
                }

                oCmd.Parameters.AddWithValue("@ConsentItemOptionID", int.Parse(ddl.SelectedValue));

                oCmd.Parameters.AddWithValue("@ItemTimeSigned", t.Text);
                oCmd.Parameters.AddWithValue("@SubjConsentItemNotes", n.Text);
                oCmd.Parameters.AddWithValue("@SubjConsentItemID", int.Parse(ht.Value));
                oCmd.ExecuteNonQuery();
            }

            ////These not enabled - not sure what the tblSubjConsentItems_Excluded table tracks.
            //oCmd.Parameters.Clear();
            //oCmd.CommandText = "spDeleteConsentItemExclusions";
            //oCmd.Parameters.Add("@SubjID", nSubjID);
            //oCmd.Parameters.Add("@ConsentFormVersionID", nConsentFormVersionID);

            //oCmd.ExecuteNonQuery();

            //oCmd.Parameters.Clear();
            //oCmd.CommandText = "spInsertSubjectConsentExclusions";
            //oCmd.Parameters.Add("@ConsentItemIDs", sConsentItemIDs);
            //oCmd.Parameters.Add("@SubjConsentID", nSubjConsentID);

            //if (oCmd.Parameters["@ConsentItemIDs"].Value.ToString() == "")
            //    oCmd.Parameters["@ConsentItemIDs"].Value = DBNull.Value;

            //oCmd.ExecuteNonQuery();
            #endregion

            //tdConsentItems.InnerHtml = "";
            //RenderConsentItems(nSubjConsentID);

            //oConn.Close();
        }
Пример #34
0
    /// <summary>
    /// 附件URL相关
    /// </summary>
    /// <param name="infos"></param>
    private void InitOption(string fileUrls)
    {
        Table t = new Table();

        t.ID = "tableFileOption";
        t.Attributes.Add("class", "FileTable");

        TableRow row = new TableRow();
        TableCell cell = new TableCell();

        //row.Attributes.Add("class", "t");

        string[] files = fileUrls.Split('|');

        if (fileUrls == "" || fileUrls.Equals(""))
        {
            row = new TableRow();
            cell = new TableCell();
            //Option Body

            HtmlInputText txt1 = new HtmlInputText();
            txt1.Size = 20;
            txt1.ID = "filename" + 1;
            txt1.Value = "附件1";
            cell.Controls.Add(txt1);

            HtmlInputText txt2 = new HtmlInputText();
            txt2.Size = 45;
            txt2.ID = "option" + 1;
            txt2.Value = "";
            cell.Controls.Add(txt2);

            //Option Id

            HtmlInputHidden hidden1 = new HtmlInputHidden();
            hidden1.ID = "filename_id_" + 1;
            hidden1.Value = "附件1";
            cell.Controls.Add(hidden1);

            HtmlInputHidden hidden2 = new HtmlInputHidden();
            hidden2.ID = "option_id_" + 1;
            hidden2.Value = "";
            cell.Controls.Add(hidden2);

            row.Cells.Add(cell);

            cell = new TableCell();
            cell.ID = "tdDel_" + 1;

            //if (i == files.Length && i != 1)
            //cell.Attributes.Add("style", "display:;");
            //else
            cell.Attributes.Add("style", "display:none;");

            cell.Text = "<a href=\"#\" onclick=\"DeletePollOption(" + 1 + ");DeleteServerOption();\"><img src=\"../images/delete1.gif\" alt=\"删除\" border=\"0\"/></a>";

            row.Cells.Add(cell);

            t.Rows.Add(row);
        }
        else
        {
            string fileName = "";
            string filePath = "";

            int index = 0;

            for (int i = 0; i < files.Length; i++)
            {
                index = i + 1;

                row = new TableRow();
                cell = new TableCell();
                //Option Body

                if (files[i] != "")
                {
                    string[] strs2 = files[i].Split('$');

                    if (strs2.Length == 1)
                    {
                        fileName = "附件" + index;
                        filePath = strs2[0];
                    }
                    else
                    {
                        fileName = strs2[0];
                        filePath = strs2[1];
                    }

                    HtmlInputText txt1 = new HtmlInputText();
                    txt1.Size = 20;
                    txt1.ID = "filename" + index;
                    txt1.Value = fileName;
                    cell.Controls.Add(txt1);

                    HtmlInputText txt2 = new HtmlInputText();
                    txt2.Size = 45;
                    txt2.ID = "option" + index;
                    txt2.Value = filePath;
                    cell.Controls.Add(txt2);

                    //Option Id

                    HtmlInputHidden hidden1 = new HtmlInputHidden();
                    hidden1.ID = "filename_id_" + index;
                    hidden1.Value = fileName;
                    cell.Controls.Add(hidden1);

                    HtmlInputHidden hidden2 = new HtmlInputHidden();
                    hidden2.ID = "option_id_" + index;
                    hidden2.Value = filePath;
                    cell.Controls.Add(hidden2);

                    row.Cells.Add(cell);

                }
                else
                {
                    HtmlInputText txt1 = new HtmlInputText();
                    txt1.Size = 20;
                    txt1.ID = "filename" + index;
                    txt1.Value = "附件" + index.ToString();
                    cell.Controls.Add(txt1);

                    HtmlInputText txt2 = new HtmlInputText();
                    txt2.Size = 45;
                    txt2.ID = "option" + index;
                    txt2.Value = "";
                    cell.Controls.Add(txt2);

                    //Option Id

                    HtmlInputHidden hidden1 = new HtmlInputHidden();
                    hidden1.ID = "filename_id_" + index;
                    hidden1.Value = "附件" + index.ToString();
                    cell.Controls.Add(hidden1);

                    HtmlInputHidden hidden2 = new HtmlInputHidden();
                    hidden2.ID = "option_id_" + index;
                    hidden2.Value = "";
                    cell.Controls.Add(hidden2);

                    row.Cells.Add(cell);
                }

                cell = new TableCell();
                cell.ID = "tdDel_" + index;

                if (index == files.Length && index != 1)
                    cell.Attributes.Add("style", "display:;");
                else
                    cell.Attributes.Add("style", "display:none;");

                cell.Text = "<a href=\"#\" onclick=\"DeletePollOption(" + index + ");DeleteServerOption('" + files[i].ToString() + "');\"><img src=\"../images/delete1.gif\" alt=\"删除\" border=\"0\"/></a>";

                row.Cells.Add(cell);

                t.Rows.Add(row);
            }
        }

        this.OptionTotal.Value = files.Length.ToString();
        phMain.Controls.Add(t);
    }
Пример #35
0
    private void EditContentHtmlScripts()
    {
        StringBuilder sbHtml = new StringBuilder();
        string strAssetID = "";
        string strSnippet = "";
        string strPath = "";
        string editLiveCSS = "";
        long copyContID = 0;
        bool addFileUpload = false;
        string MenuItemType;

        if (content_stylesheet.Length > 0)
        {
            strPath = (string)(GetServerPath() + SitePath + content_stylesheet);
            editLiveCSS = (string)("&css=" + content_stylesheet);
        }
        if (!String.IsNullOrEmpty (Request.QueryString["content_id"]))
        {
            //this key is also used for media asset translated.
            copyContID = Convert.ToInt64(Request.QueryString["content_id"]);
        }

        isOfficeDoc.Value = "false";
        MultiupLoadTitleMsg.Text = "";
        content_title.Visible = true;
        this.type.Value = "";

        if ((IsMac) && !(Utilities.IsAsset(lContentType, strAssetID)))
        {
            if (content_edit_data != null && (content_edit_data.Type == 1 || content_edit_data.Type == 3) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
            {
                string typeaction = Request.QueryString["type"];
                if ((typeaction != null) && typeaction.ToLower() == "update")
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                linebreak.InnerHtml = "<br /><br />";
                m_ctlContentPane.Controls.Add(linebreak);
                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                htmlGen.InnerHtml = Ektron.Cms.PageBuilder.PageData.RendertoString(content_edit_data.Html);
                m_ctlContentPane.Controls.Add(htmlGen);
            }
            else if ("ContentDesigner" == m_SelectedEditControl)
            {
                m_ctlContentDesigner.Visible = true;
                m_ctlContentDesigner.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                m_ctlContentDesigner.Height = new Unit(635, UnitType.Pixel);
                if (content_stylesheet.Length > 0)
                {
                    m_ctlContentDesigner.Stylesheet = strPath;
                }
                if (editorPackage.Length > 0)
                {
                    m_ctlContentDesigner.LoadPackage(m_refContApi, editorPackage);
                    m_ctlContentDesigner.DataDocumentXml = m_strContentHtml;
                }
                else
                {
                    m_ctlContentDesigner.Content = m_strContentHtml;
                }
                m_ctlContentValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(iMaxContLength);
                m_ctlContentValidator.Visible = true;
            }
            else
            {
                if (!IsBrowserIE)
                {
                    sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"true\">");
                    sbHtml.Append("<input type=\"hidden\" name=\"selectedtext\" id=\"selectedtext\">");
                    sbHtml.Append("<input type=\"hidden\" name=\"selectedhtml\" id=\"selectedhtml\">");
                    System.Text.StringBuilder strJSEditLive = new System.Text.StringBuilder();
                    strJSEditLive.Append("<script language=\"JavaScript\" src=\"" + this.AppeWebPath + "editlivejava/editlivejava.js\"></script>" + "\r\n");
                    sbHtml.Append("<input type=\"hidden\" name=\"EphoxContent\" id=\"EphoxContent\" value=\"" + EkFunctions.UrlEncode(Server.HtmlDecode(m_strContentHtml)) + "\">");
                    strJSEditLive.Append("<script language=\"JavaScript\">" + "\r\n");
                    strJSEditLive.Append("      var strContent;");
                    strJSEditLive.Append("		elx1 = new EditLiveJava(\"content_html\", \"700\", \"400\");");
                    strJSEditLive.Append("		elx1.setXMLURL(\"" + this.AppeWebPath + "editlivejava/config.aspx?apppath=" + this.AppPath + "&sitepath=" + this.SitePath + editLiveCSS + "\");");
                    strJSEditLive.Append("      elx1.setOutputCharset(\"UTF-8\");");
                    strJSEditLive.Append("		elx1.setBody(document.forms[0].EphoxContent.value);");
                    strJSEditLive.Append("		elx1.setDownloadDirectory(\"" + this.AppeWebPath + "editlivejava\");");
                    strJSEditLive.Append("		elx1.setLocalDeployment(false);");
                    strJSEditLive.Append("		elx1.setCookie(\"\");");
                    strJSEditLive.Append("		elx1.show();" + "\r\n");
                    strJSEditLive.Append("	</script>" + "\r\n");
                    sbHtml.Append(strJSEditLive.ToString());
                }
                else
                {
                    sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"false\">");
                    sbHtml.Append("<textarea id=\"content_html\" name=\"content_html\" cols=\"90\" rows=\"24\" ID=\"Textarea2\">" + m_strContentHtml + "</textarea>");
                }
                Literal litSnippet = new Literal();
                litSnippet.ID = "ephox_control_literal";
                litSnippet.Text = sbHtml.ToString();
                m_ctlContentPane.Controls.Add(litSnippet);
            }
        }
        else
        {
            sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"false\">");
            strAssetID = asset_info["AssetID"].ToString();
            if (content_edit_data != null && (content_edit_data.Type == 1 || content_edit_data.Type == 3) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
            {
                string typeaction = Request.QueryString["type"];

                if ((typeaction != null) && typeaction.ToLower() == "update")
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                linebreak.InnerHtml = "<br /><br />";
                m_ctlContentPane.Controls.Add(linebreak);
                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                htmlGen.InnerHtml = Ektron.Cms.PageBuilder.PageData.RendertoString(content_edit_data.Html);
                m_ctlContentPane.Controls.Add(htmlGen);
            }
            else if (Utilities.IsAsset(lContentType, strAssetID))
            {
                if (m_strType == "multiple,add")
                {
                    bool isUrlAliasRequired = false;

                    FolderData fdTmp = this.m_refContApi.EkContentRef.GetFolderById(Int64.Parse(Request.QueryString["folderid"]));
                    Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

                    if (m_urlAliasSettings.IsManualAliasEnabled)
                    {
                        if (fdTmp.AliasRequired)
                        {
                            isUrlAliasRequired = true;
                        }
                    }

                    jsManualAliasAlert.Text = m_refMsg.GetMessage("js:url aliasing is required dms mupload");// "Url aliasing is required for this folder. Non-image assets will be uploaded but unpublished.";

                    if (Request.Cookies[DMSCookieName] != null && !string.IsNullOrEmpty(Request.Cookies[DMSCookieName].Value))
                    {
                        if (Request.Cookies[DMSCookieName].Value == "2010")
                        {
                            if (isUrlAliasRequired)
                            {
                                jsfolderRequireManualAlias2010.Text = "true";
                            }

                            Button btnMupload = new Button();
                            //btnMupload.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                            btnMupload.ID = "btnMupload";
                            btnMupload.Text = "Upload";
                            btnMupload.Attributes.Add("onclick", "return DocumentUploadOffice2010()");
                            m_ctlContentPane.Controls.Add(btnMupload);
                        }
                        else
                        {
                            if (isUrlAliasRequired)
                            {
                                jsfolderRequireManualAlias.Text = "true";
                            }
                            HiddenField hfTmp = new HiddenField();
                            hfTmp.ID = "FromMenuMultiDMS";
                            hfTmp.Value = "";
                            m_ctlContentPane.Controls.Add(hfTmp);

                        }
                    }

                    HtmlGenericControl linebreak = new HtmlGenericControl("div");
                    linebreak.InnerHtml += "<br /><br />" + "\r\n";
                    linebreak.InnerHtml += "<div id=idMultipleView style=\'display:none\'>";
                    linebreak.InnerHtml += "<script type=\"text/javascript\">" + "\r\n";
                    linebreak.InnerHtml += " AC_AX_RunContent(\'id\',\'idUploadCtl\',\'name\',\'idUploadCtl\',\'classid\',\'CLSID:07B06095-5687-4d13-9E32-12B4259C9813\',\'width\',\'100%\',\'height\',\'350px\');" + "\r\n";
                    linebreak.InnerHtml += "\r\n" + " </script> </div> " + "\r\n";
                    linebreak.InnerHtml += "<br /><br />";
                    linebreak.InnerHtml += "<div> " + m_refMsg.GetMessage("lbl valid file types") + DocumentManagerData.Instance.FileTypes + "</div>";
                    m_ctlContentPane.Controls.Add(linebreak);
                    strSnippet += "\r\n" + "<script language=\"JavaScript\">" + "\r\n";
                    strSnippet += "MultipleUploadView();" + "\r\n";
                    strSnippet += "\r\n" + "</script>";
                    content_title.Visible = false;
                    MultiupLoadTitleMsg.Text = m_refMsg.GetMessage("lbl msg for multiupload title");
                    this.type.Value = "multiple,add";
                }
                else if (strAssetID.Length == 0)
                {
                    HtmlGenericControl linebreak = new HtmlGenericControl("div");
                    linebreak.InnerHtml = "<br /><br />";
                    m_ctlContentPane.Controls.Add(linebreak);
                    HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                    htmlGen.InnerHtml =  m_refMsg.GetMessage("lbl upload file");
                    m_ctlContentPane.Controls.Add(htmlGen);
                    HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                    fileUploadWrapper.ID = "fileUploadWrapper";
                    System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                    fileUpload.ID = "fileupload";
                    fileUploadWrapper.Controls.Add(fileUpload);
                    m_ctlContentPane.Controls.Add(fileUploadWrapper);
                    oldfilename.Value = "";
                    addFileUpload = true;
                    this.type.Value = "add";
                }
                else
                {
                    if (lContentType == Ektron.Cms.Common.EkConstants.CMSContentType_Media)
                    {

                        Multimedia_commonparams mediaParams;
                        mediaParams = (Multimedia_commonparams)(LoadControl("controls/media/commonparams.ascx"));
                        mediaParams.ID = m_strContentTitle;
                        if (m_strType == "add" && copyContID != 0)
                        {
                            mediaParams.ContentHtml = this.m_refContent.CreateMediaXML(content_data.AssetData, m_intContentFolder);
                            mediaParams.AssetID = content_data.AssetData.Id;
                            mediaParams.MimeType = content_data.AssetData.MimeType;
                            mediaParams.AssetVersion = content_data.AssetData.Version;
                            mediaParams.AssetFileName = m_refContApi.GetViewUrl(content_data.AssetData.Id, Ektron.Cms.Common.EkConstants.CMSContentType_Media);
                        }
                        else
                        {
                            mediaParams.ContentHtml = m_strContentHtml;
                            mediaParams.AssetID = strAssetID;
                            mediaParams.MimeType = asset_info["MimeType"].ToString();
                            mediaParams.AssetVersion = asset_info["AssetVersion"].ToString();
                            mediaParams.AssetFileName = m_refContApi.RequestInformationRef.AssetPath + m_refContApi.EkContentRef.GetFolderParentFolderIdRecursive(content_edit_data.FolderId).Replace(",", "/") + "/" + content_edit_data.AssetData.Id + "." + content_edit_data.AssetData.FileExtension;
                            mediaParams.AssetFileName = (content_edit_data.IsPrivate ? m_refContApi.RequestInformationRef.SitePath + "PrivateAssets/" : m_refContApi.RequestInformationRef.AssetPath) + m_refContApi.EkContentRef.GetFolderParentFolderIdRecursive(content_edit_data.FolderId).Replace(",", "/") + "/" + content_edit_data.AssetData.Id + "." + content_edit_data.AssetData.FileExtension;
                        }

                        m_ctlContentPane.Controls.Add(mediaParams);
                    }
                    else
                    {
                        //check for type = 'add' here
                        if (m_strType == "add")
                        {
                            HtmlGenericControl linebreak = new HtmlGenericControl("div");
                            linebreak.InnerHtml = "<br /><br />";
                            m_ctlContentPane.Controls.Add(linebreak);
                            HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                            htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                            HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                            fileUploadWrapper.ID = "fileUploadWrapper";
                            System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                            fileUpload.ID = "fileupload";
                            fileUploadWrapper.Controls.Add(fileUpload);
                            m_ctlContentPane.Controls.Add(fileUploadWrapper);
                            oldfilename.Value = "";
                            addFileUpload = true;
                        }
                        else
                        {
                            if (Ektron.ASM.AssetConfig.ConfigManager.IsOfficeDoc(content_edit_data.AssetData.FileExtension))
                            {

                                AssetManagement.AssetManagementService assetmanagementService = new AssetManagement.AssetManagementService();
                                Ektron.ASM.AssetConfig.AssetData assetData = assetmanagementService.GetAssetData(content_edit_data.AssetData.Id);
                                string strfilename;
                                strfilename = (string)(GetFolderPath(content_edit_data.FolderId) + assetData.Handle);
                                filename.Value = strfilename;
                                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                                linebreak.InnerHtml = "<br /><br /> Currently uploaded file: " + assetData.Handle + " <br /><br />";
                                m_ctlContentPane.Controls.Add(linebreak);
                                m_ctlContentPane.Controls.Add(linebreak);
                                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                                htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                                m_ctlContentPane.Controls.Add(htmlGen);

                                HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                                fileUploadWrapper.ID = "fileUploadWrapper";

                                System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                                fileUpload.ID = "fileupload";

                                fileUploadWrapper.Controls.Add(fileUpload);
                                m_ctlContentPane.Controls.Add(fileUploadWrapper);

                                oldfilename.Value = assetData.Handle;
                                //This hidden field is used to hide content tab if office is not installed or browser is non-ie, else show content tab with browse button
                                isOfficeDoc.Value = "true";
                            }
                            else
                            {
                                AssetManagement.AssetManagementService assetmanagementService = new AssetManagement.AssetManagementService();
                                Ektron.ASM.AssetConfig.AssetData assetData = assetmanagementService.GetAssetData(asset_info["AssetID"].ToString());
                                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                                linebreak.InnerHtml = "<br /><br /> Currently uploaded file: " + assetData.Handle + " <br /><br />";
                                m_ctlContentPane.Controls.Add(linebreak);
                                m_ctlContentPane.Controls.Add(linebreak);
                                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                                htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                                m_ctlContentPane.Controls.Add(htmlGen);

                                HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                                fileUploadWrapper.ID = "fileUploadWrapper";

                                System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                                fileUpload.ID = "fileupload";

                                fileUploadWrapper.Controls.Add(fileUpload);
                                m_ctlContentPane.Controls.Add(fileUploadWrapper);

                                oldfilename.Value = assetData.Handle;
                            }
                            MenuItemType = Request.QueryString["menuItemType"];
                            if ((MenuItemType != null) && MenuItemType.ToLower() == "editproperties")
                            {
                                isOfficeDoc.Value = "true";
                            }
                        }
                    }
                }
                sbHtml.Append(strSnippet);

                sbHtml.Append("<input type=\"hidden\" id=\"content_html\" name=\"content_html\" value=\"" + EkFunctions.HtmlEncode(m_strContentHtml) + "\">");

                //fix for 32909 - in case of Add multimedia file to Menu, lContentType is CMSContentType_Media but
                //since it is add we show the fileupload browse button, not the DragDropExplorer control
                if ((lContentType == Ektron.Cms.Common.EkConstants.CMSContentType_Media) && (addFileUpload == false) && m_strType == "update")
                {
                    HtmlGenericControl DragDropContainer = new HtmlGenericControl("div");
                    DragDropContainer.ID = "DragDropContainer";
                    DragDropContainer.Style.Add("width", "35%");
                    string multiUploadAssetID = "&AssetID=" + m_refContentId.ToString();
                    string multiUploadTaxString = string.Empty;
                    TaxonomyBaseData[] taxonomies = m_refContent.ReadAllAssignedCategory(m_refContentId);
                    if (!((taxonomies == null)) && taxonomies.Length > 0)
                    {
                        multiUploadTaxString = "&TaxonomyId=" + taxonomies[0].Id.ToString();
                    }
                    Literal uploaderSnippet = new Literal();
                    uploaderSnippet.ID = "UploadSnippet";
                    editaction.Value = m_strType;
                    uploaderSnippet.Text = m_refMsg.GetMessage("lbl upload file replace") + ": " + "<a href=\"" + m_refContApi.AppPath + "DragDropCtl.aspx?id=" + m_intContentFolder.ToString() + multiUploadAssetID + multiUploadTaxString + "&lang_id=" + m_intContentLanguage.ToString() + "&hideMultiple=true&forceExtension=true&EkTB_iframe=true&height=120&width=500&refreshCaller=true&scrolling=false&modal=true\" class=\"ek_thickbox\" title=\"" + m_refMsg.GetMessage("Document Management System") + "\"><img id=\"DeskTopHelp\" title= \"" + m_refMsg.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a>";
                    DragDropContainer.Controls.Add(uploaderSnippet);
                    m_ctlContentPane.Controls.Add(DragDropContainer);
                }
                Literal litSnippet = new Literal();
                litSnippet.ID = "ContentHtml";
                litSnippet.Text = sbHtml.ToString();
                m_ctlContentPane.Controls.Add(litSnippet);
            }
            else
            {
                if (m_strType == "add" && (content_data != null) && (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlInputHidden ctlEphox = new HtmlInputHidden();
                ctlEphox.ID = "ephox";
                ctlEphox.Value = "false";
                m_ctlContentPane.Controls.Add(ctlEphox);

                if ("ContentDesigner" == m_SelectedEditControl)
                {
                    m_ctlContentDesigner.Visible = true;
                    m_ctlContentDesigner.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                    m_ctlContentDesigner.Height = new Unit(635, UnitType.Pixel);
                    if (content_stylesheet.Length > 0)
                    {
                        m_ctlContentDesigner.Stylesheet = strPath;
                    }
                    if (editorPackage.Length > 0)
                    {
                        m_ctlContentDesigner.LoadPackage(m_refContApi, editorPackage);
                        m_ctlContentDesigner.DataDocumentXml = m_strContentHtml;
                    }
                    else
                    {
                        m_ctlContentDesigner.Content = m_strContentHtml;
                    }
                    m_ctlContentValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(iMaxContLength);
                    m_ctlContentValidator.Visible = true;
                }
                else
                {
                    Ektron.Cms.Controls.HtmlEditor ctlEditor = new Ektron.Cms.Controls.HtmlEditor();
                    ctlEditor.WorkareaMode(2);
                    ctlEditor.ID = "content_html";
                    ctlEditor.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                    ctlEditor.Height = new Unit(100, UnitType.Percentage);
                    ctlEditor.Path = AppeWebPath;
                    ctlEditor.MaxContentSize = iMaxContLength;
                    ctlEditor.Locale = AppeWebPath + "locale" + AppLocaleString + "b.xml";
                    if (editorPackage.Length > 0)
                    {
                        Ektron.WebEditorNet2.eWebEditProField objField;
                        objField = new Ektron.WebEditorNet2.eWebEditProField();
                        objField.Name = "datadesignpackage";
                        objField.SetContentType = "datadesignpackage";
                        objField.GetContentType = "";
                        objField.Text = editorPackage;
                        ctlEditor.Fields.Add(objField);

                        objField = new Ektron.WebEditorNet2.eWebEditProField();
                        objField.Name = "datadocumentxml";
                        objField.SetContentType = "datadocumentxml";
                        objField.GetContentType = ""; // content is retrieved manually
                        objField.Text = m_strContentHtml;
                        ctlEditor.Fields.Add(objField);
                        objField = null;
                    }
                    else
                    {
                        ctlEditor.Text = m_strContentHtml;
                    }
                    System.Web.UI.HtmlControls.HtmlGenericControl eWebEditProWrapper = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                    eWebEditProWrapper.Attributes.Add("class", "ewebeditproWrapper ewebeditpro_dvContent");
                    eWebEditProWrapper.Controls.Add(ctlEditor);
                    m_ctlContentPane.Controls.Add(eWebEditProWrapper);
                }
            }
        }
        // fix for Defect: #43308, why output this tab if you are jsut going to hide it?  We always hide it for
        //   office docs, so...IE ONLY
        //if (isOfficeDoc.Value == "true" && IsBrowserIE)
        //{
        //    phContent.Visible = false;
        //    phEditContent.Visible = false;
        //}

          if (!String.IsNullOrEmpty(m_strContentHtml))
          {
              if (m_ctlContentDesigner != null)
              {
                  m_ctlContentDesigner.CurrentCharCount = m_strContentHtml.Length;

                  if (m_ctlContentDesigner.CurrentCharCount > m_ctlContentDesigner.WordPasteThreshold)
                  {
                      m_ctlContentDesigner.ShowPasteWarning = false;

                      WarningMessage.Visible = true;
                      WarningMessage.Text = m_refMsg.GetMessage("WordPasteWarningMessage");
                  }
              }
          }
    }