public static void verificaCampiPersonalizzati(Page page, SAAdminTool.DocsPaWR.Fascicolo fascicolo, Microsoft.Web.UI.WebControls.TreeView Folders, bool editMode) { System.Web.UI.WebControls.DropDownList ddl_tipoFasc = (System.Web.UI.WebControls.DropDownList)page.FindControl("ddl_tipologiaFasc"); System.Web.UI.WebControls.ImageButton btn_CampiPersonalizzati = (System.Web.UI.WebControls.ImageButton)page.FindControl("img_btnDettagliProf"); System.Web.UI.WebControls.TextBox txt_fascdesc = (System.Web.UI.WebControls.TextBox)page.FindControl("txt_fascdesc"); //Fascicolo senza tipologia (Apro la lista documenti in fascicolo) if (fascicolo != null && (fascicolo.template == null || fascicolo.template.SYSTEM_ID == 0) && string.IsNullOrEmpty(ddl_tipoFasc.SelectedValue)) { ddl_tipoFasc.Enabled = editMode; btn_CampiPersonalizzati.Enabled = editMode; page.Session["ListaDocs-CampiProf"] = "ListaDocs"; string urlFormattata = System.Text.RegularExpressions.Regex.Replace(txt_fascdesc.Text, @"[\000\010\011\012\015\032\042\047\134\140]", "\\$0"); string newUrl = "tabPulsantiDoc.aspx?idFolder=" + getSelectedNodeFolder(page, Folders).ID.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + urlFormattata; page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true); } //Fascicolo con tipologia (Apro i campi profilati del fascicolo) if (System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] != null && System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] == "1" && fascicolo.tipo.Equals("P")) { //Fasciolo con template salvato if (fascicolo != null && fascicolo.template != null && fascicolo.template.SYSTEM_ID != 0) { ddl_tipoFasc.Enabled = false; btn_CampiPersonalizzati.Enabled = true; System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(fascicolo.template.DESCRIZIONE, fascicolo.template.SYSTEM_ID.ToString()); if (!ddl_tipoFasc.Items.Contains(item)) { ddl_tipoFasc.Items.Add(item); ddl_tipoFasc.SelectedValue = item.Value; } page.Session["Template"] = fascicolo.template; page.Session["ListaDocs-CampiProf"] = "CampiProf"; string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&codTipologiaFasc=" + ddl_tipoFasc.SelectedValue.ToString() + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + txt_fascdesc.Text; page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true); } //Fasciolo con template appena selezionato if (fascicolo != null && fascicolo.template != null && fascicolo.template.SYSTEM_ID == 0 && !string.IsNullOrEmpty(ddl_tipoFasc.SelectedValue)) { ddl_tipoFasc.Enabled = true; btn_CampiPersonalizzati.Enabled = true; page.Session["ListaDocs-CampiProf"] = "CampiProf"; string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&codTipologiaFasc=" + ddl_tipoFasc.SelectedValue.ToString() + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + txt_fascdesc.Text; page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true); } } else { if (fascicolo != null) { string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString(); page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true); } } }
/// <summary> /// Add the confirm message to button /// Created : GuangMing Chu, 1 1,2007 /// Modified: GuangMing Chu, 1 1,2007 /// Modified: /// 代码调用: /// UIHelper.AddConfirm(this.Button1, "真的要删了??); /// 点确定按钮就会执行事件中的代码,点取消不? /// /// </summary> /// <param name="button">The control, must be a button</param> /// <param name="strMsg">The popup message</param> public static void AddConfirm(System.Web.UI.WebControls.ImageButton button, string strMsg) { strMsg = strMsg.Replace("\n", "file://n/"); strMsg = strMsg.Replace("\r", "file://r/"); strMsg = strMsg.Replace("\"", "\\\""); strMsg = strMsg.Replace("\'", "\\\'"); button.Attributes.Add("onClick", "return confirm('" + strMsg + "')"); }
/// <summary> /// ImageButton控件翻译,从数据库中取值 /// </summary> /// <param name="button">要翻译的服务器控件</param> /// <param name="keyCode">字典键值</param> /// <param name="defaultText">默认值</param> public static void TranslationImageButtonDB(System.Web.UI.WebControls.ImageButton button, string keyCode, string defaultText) { string tlText = string.Empty; tlText = Translate(keyCode); if (tlText == "") { tlText = defaultText; } button.AlternateText = tlText; }
/// <summary> /// 服务器控件的翻译,从数据库中取值 /// </summary> /// <param name="control">要翻译的控件</param> /// <param name="items">二维数组型参数,第二维第一个为字典键值,第二个为默认值</param> public void TranControlsDB(object control, string[][] items) { switch (control.GetType().ToString()) // { case "System.Web.UI.WebControls.GridView": System.Web.UI.WebControls.GridView gv = (System.Web.UI.WebControls.GridView)control; Translation.TranslationGridViewDB(gv, items); break; case "System.Web.UI.WebControls.DataGrid": System.Web.UI.WebControls.DataGrid dg = (System.Web.UI.WebControls.DataGrid)control; Translation.TranslationDataGridDB(dg, items); break; case "System.Web.UI.WebControls.RadioButtonList": System.Web.UI.WebControls.RadioButtonList rbl = (System.Web.UI.WebControls.RadioButtonList)control; Translation.TranslationRadioButtonListDB(rbl, items); break; case "System.Web.UI.WebControls.DropDownList": System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)control; Translation.TranslationDropDownListDB(ddl, items); break; case "System.Web.UI.WebControls.CheckBoxList": System.Web.UI.WebControls.CheckBoxList chkl = (System.Web.UI.WebControls.CheckBoxList)control; Translation.TranslationCheckBoxListDB(chkl, items); break; case "System.Web.UI.WebControls.Button": System.Web.UI.WebControls.Button button = (System.Web.UI.WebControls.Button)control; Translation.TranslationButtonDB(button, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.LinkButton": System.Web.UI.WebControls.LinkButton lbtn = (System.Web.UI.WebControls.LinkButton)control; Translation.TranslationLinkButtonDB(lbtn, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.ImageButton": System.Web.UI.WebControls.ImageButton imgBtn = (System.Web.UI.WebControls.ImageButton)control; Translation.TranslationImageButtonDB(imgBtn, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.HyperLink": System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)control; Translation.TranslationHyperLinkDB(hl, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.Label": System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)control; Translation.TranslationLabelDB(label, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.CheckBox": System.Web.UI.WebControls.CheckBox chk = (System.Web.UI.WebControls.CheckBox)control; Translation.TranslationCheckBoxDB(chk, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.RadioButton": System.Web.UI.WebControls.RadioButton rbtn = (System.Web.UI.WebControls.RadioButton)control; Translation.TranslationRadioButtonDB(rbtn, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.RequiredFieldValidator": System.Web.UI.WebControls.RequiredFieldValidator rfv = (System.Web.UI.WebControls.RequiredFieldValidator)control; Translation.TranslationRequiredFieldValidatorDB(rfv, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.RangeValidator": System.Web.UI.WebControls.RangeValidator rv = (System.Web.UI.WebControls.RangeValidator)control; Translation.TranslationRangeValidatorDB(rv, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.CompareValidator": System.Web.UI.WebControls.CompareValidator cv = (System.Web.UI.WebControls.CompareValidator)control; Translation.TranslationCompareValidatorDB(cv, items[0][0], items[0][1]); break; case "System.Web.UI.WebControls.RegularExpressionValidator": System.Web.UI.WebControls.RegularExpressionValidator rev = (System.Web.UI.WebControls.RegularExpressionValidator)control; Translation.TranslationRegularExpressionValidatorDB(rev, items[0][0], items[0][1]); break; } }
// Methods protected override void CreateChildControls() { this.Controls.Clear(); this._logInLinkButton = new LinkButton(); this._logInImageButton = new ImageButton(); this._logOutLinkButton = new LinkButton(); this._logOutImageButton = new ImageButton(); this._logInLinkButton.EnableViewState = false; this._logInImageButton.EnableViewState = false; this._logOutLinkButton.EnableViewState = false; this._logOutImageButton.EnableViewState = false; this._logInLinkButton.EnableTheming = false; this._logInImageButton.EnableTheming = false; this._logInLinkButton.CausesValidation = false; this._logInImageButton.CausesValidation = false; this._logOutLinkButton.EnableTheming = false; this._logOutImageButton.EnableTheming = false; this._logOutLinkButton.CausesValidation = false; this._logOutImageButton.CausesValidation = false; CommandEventHandler handler = new CommandEventHandler(this.LogoutClicked); this._logOutLinkButton.Command += handler; this._logOutImageButton.Command += handler; handler = new CommandEventHandler(this.LoginClicked); this._logInLinkButton.Command += handler; this._logInImageButton.Command += handler; this.Controls.Add(this._logOutLinkButton); this.Controls.Add(this._logOutImageButton); this.Controls.Add(this._logInLinkButton); this.Controls.Add(this._logInImageButton); }
/// <summary> /// 弹出确认窗口,如果点击否则不执行操作 /// </summary> /// <param name="btn">绑定的按钮</param> /// <param name="Message">提示信息</param> public static void popupConfirmMessageHXH(System.Web.UI.WebControls.ImageButton btn, string Message) { btn.Attributes.Add("OnClick", "javascript:window.event.returnValue=window.confirm('" + Message + "');"); }
protected override void AttachChildControls() { this.calendarStartDate = (WebCalendar)this.FindControl("calendarStartDate"); this.calendarEndDate = (WebCalendar)this.FindControl("calendarEndDate"); this.hdorderId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdorderId"); this.txtOrderId = (System.Web.UI.WebControls.TextBox) this.FindControl("txtOrderId"); this.txtProductName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtProductName"); this.txtShipId = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipId"); this.txtShipTo = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipTo"); this.txtCellPhone = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCellPhone"); this.txtRemark = (System.Web.UI.WebControls.TextBox) this.FindControl("txtRemark"); this.txtReturnRemark = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReturnRemark"); this.txtReplaceRemark = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReplaceRemark"); this.dropOrderStatus = (OrderStautsDropDownList)this.FindControl("dropOrderStatus"); this.dropPayType = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropPayType"); this.btnPay = ButtonManager.Create(this.FindControl("btnPay")); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.btnOk = ButtonManager.Create(this.FindControl("btnOk")); this.btnReturn = ButtonManager.Create(this.FindControl("btnReturn")); this.btnReplace = ButtonManager.Create(this.FindControl("btnReplace")); this.litOrderTotal = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal"); this.dropRefundType = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropRefundType"); this.dropRefundReason = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropRefundReason"); this.dropReturnReason = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropReturnReason"); this.dropReturnRefundType = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropReturnRefundType"); this.listOrders = (Common_OrderManage_OrderList)this.FindControl("Common_OrderManage_OrderList"); this.pager = (Pager)this.FindControl("pager"); this.hlinkAllOrder = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkAllOrder"); this.hlinkNotPay = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkNotPay"); this.hlinkNotGetGoods = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkNotGetGoods"); this.hlinkFinished = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkFinished"); this.hlinkRefund = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkRefund"); this.hlinkReturn = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkReturn"); this.dropLogisticsCompany = (LogisticsCompanyDropDownList)this.FindControl("dropLogisticsCompany"); this.txtLogisticsId = (System.Web.UI.WebControls.TextBox) this.FindControl("txtLogisticsId"); this.quantityList = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("quantityList"); this.skuIds = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("skuIds"); this.LogisticsCompany = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("LogisticsCompany"); this.LogisticsId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("LogisticsId"); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); this.btnPay.Click += new System.EventHandler(this.btnPay_Click); this.btnOk.Click += new System.EventHandler(this.btnOk_Click); this.btnReturn.Click += new System.EventHandler(this.btnReturn_Click); this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click); this.listOrders.ItemDataBound += new Common_OrderManage_OrderList.DataBindEventHandler(this.listOrders_ItemDataBound); this.listOrders.ItemCommand += new Common_OrderManage_OrderList.CommandEventHandler(this.listOrders_ItemCommand); //this.rptOrderProducts = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts"); //物流选择绑定值 //IList<string> list = ExpressHelper.GetAllExpressName(); //List<ListItem> item = new List<ListItem>(); //foreach (string s in list) //{ // item.Add(new ListItem(s, s)); //} //dropLogisticsCompany.Items.AddRange(item.ToArray()); PageTitle.AddSiteNameTitle("我的订单"); if (!this.Page.IsPostBack) { this.OrderRefundTime = string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["OrderRefunTime"]) ? 30 : int.Parse(System.Configuration.ConfigurationManager.AppSettings["OrderRefunTime"].ToString()); this.SetOrderStatusLink(); this.dropPayType.DataSource = TradeHelper.GetPaymentModes(PayApplicationType.payOnPC); this.dropPayType.DataTextField = "Name"; this.dropPayType.DataValueField = "ModeId"; this.dropPayType.DataBind(); this.BindOrders(); dropLogisticsCompany.DataBind(); BindRefundReason(); BindReturnReason(); } //this.rptOrderProducts.DataSource = ShoppingProcessor.GetOrderItems(orderId); //this.rptOrderProducts.DataBind(); }