Beispiel #1
0
    protected void ugrdEstOpinion_InitializeRow(object sender, RowEventArgs e)
    {
        string          sFileId = (e.Row.Cells.FromKey("REVIEW_FILE_ID").Value == null) ? "" : e.Row.Cells.FromKey("REVIEW_FILE_ID").Value.ToString();
        TemplatedColumn colEst  = (TemplatedColumn)e.Row.Cells.FromKey("EST_LEVEL_NAME").Column;

        System.Web.UI.WebControls.Label       lblLevel = (System.Web.UI.WebControls.Label)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("lblEST_LEVEL_NAME");
        System.Web.UI.WebControls.ImageButton btnFile  = (System.Web.UI.WebControls.ImageButton)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iBtnReviewFile");
        System.Web.UI.WebControls.HiddenField hdfFile  = (System.Web.UI.WebControls.HiddenField)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iHdfReviewFile");

        lblLevel.Text = (e.Row.Cells.FromKey("EST_LEVEL_NAME").Value == null) ? "" : e.Row.Cells.FromKey("EST_LEVEL_NAME").Value.ToString();
        string sOpinion = (e.Row.Cells.FromKey("OPINION").Value == null) ? "" : e.Row.Cells.FromKey("OPINION").Value.ToString();

        if (sOpinion == "")
        {
            e.Row.Hidden = true;
        }

        if (sFileId.Length > 0)
        {
            hdfFile.Value         = sFileId;
            btnFile.Visible       = true;
            btnFile.OnClientClick = "return mfUpload('" + hdfFile.ClientID.Replace("$", "_") + "')";
        }
        else
        {
            hdfFile.Value   = "";
            btnFile.Visible = false;
        }
    }
Beispiel #2
0
        private void AddUpdatePanel(Panel p)
        {
            this.messageLabel = new Label();

            this.updatePanel = new UpdatePanel();
            this.updatePanel.ID = "ScrudUpdatePanel";
            this.updatePanel.ChildrenAsTriggers = true;
            this.updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.topCommandPanel.GetCommandPanel("top"));
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.messageLabel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.gridPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.formPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.bottomCommandPanel.GetCommandPanel("bottom"));

            //Bottom command panel.
            this.userIdHidden = new HiddenField();
            this.userIdHidden.ID = "UserIdHidden";
            this.userIdHidden.Value = this.UserId.ToString(CultureInfo.InvariantCulture);

            this.officeCodeHidden = new HiddenField();
            this.officeCodeHidden.ID = "OfficeCodeHidden";
            this.officeCodeHidden.Value = this.OfficeCode;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.userIdHidden);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.officeCodeHidden);
            p.Controls.Add(this.updatePanel);
        }
Beispiel #3
0
    protected void grdTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //e.Row.Cells[2].Style.Add(HtmlTextWriterStyle.TextAlign, "left");
            e.Row.Cells[3].Style.Add(HtmlTextWriterStyle.TextAlign, "left");
            e.Row.Cells[9].Style.Add(HtmlTextWriterStyle.TextAlign, "right");
            e.Row.Cells[10].Style.Add(HtmlTextWriterStyle.TextAlign, "right");

            string sFile = DataBinder.Eval(e.Row.DataItem, "ATT_FILE").ToString();
            System.Web.UI.WebControls.ImageButton imgFile = (System.Web.UI.WebControls.ImageButton)e.Row.FindControl("imgFile");

            if (sFile == "")
            {
                imgFile.Visible = false;
            }
            else
            {
                System.Web.UI.WebControls.HiddenField hdfFile = (System.Web.UI.WebControls.HiddenField)e.Row.FindControl("hdfFile");
                hdfFile.Value = sFile;

                imgFile.OnClientClick = "return mfUpload('" + hdfFile.ClientID + "'); return false;";
            }
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
        }
    }
Beispiel #4
0
        protected void AgregarControles(Label nombreContr, CheckBox chB, TextBox tbox, HiddenField nuevoHidF, Label hrReg, Label observ)
        {
            try
            {
                PanelConVisita.Controls.Add(new LiteralControl("<tr>"));
                PanelConVisita.Controls.Add(new LiteralControl("<td>"));
                PanelConVisita.Controls.Add(nombreContr);
                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                PanelConVisita.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;"));
                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                if (hrReg == null)
                {
                    PanelConVisita.Controls.Add(chB);
                }
                else
                {
                    PanelConVisita.Controls.Add(hrReg);
                }

                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                if (hrReg == null)
                {
                    PanelConVisita.Controls.Add(tbox);
                }
                else
                {
                    PanelConVisita.Controls.Add(observ);
                }
                PanelConVisita.Controls.Add(new LiteralControl("</td></tr>"));
            }
            catch (Exception ex)
            {
                return;
            }
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageUploader"/> class.
 /// </summary>
 public ImageUploader()
     : base()
 {
     HelpBlock = new HelpBlock();
     _hfBinaryFileId = new HiddenField();
     _hfBinaryFileTypeGuid = new HiddenField();
 }
Beispiel #6
0
 public Imagem(Image Image, HiddenField Hidden, string Path, string Arquivo)
 {
     this.Image = Image;
     this.Hidden = Hidden;
     this.Path = Path;
     this.Arquivo = Arquivo;
 }
Beispiel #7
0
        private void displayShow(PlaceHolder placeholder, int shid)
        {
            placeholder.Controls.Clear();
            Show show = new Show();
            show.id = Convert.ToInt32(Request["shid"]);
            show.get();

            TextBox tickets = new TextBox();
            tickets.ID = "numOfTickets";

            Button order = new Button();
            order.Text = "Order!";
            order.Click += new System.EventHandler(this.orderClick);

            HiddenField hiddenShid = new HiddenField();
            hiddenShid.Value = shid.ToString();
            hiddenShid.ID = "hiddenShid";

            placeholder.Controls.Add(new LiteralControl("<h1>"+show.read("moid", true)+" @ "+show.read("show_start")+"</h1>"));
            placeholder.Controls.Add(new LiteralControl("<p>### tickets left</p>"));
            placeholder.Controls.Add(new LiteralControl("<p>Please input # of tickets you want to order</p>"));
            placeholder.Controls.Add(tickets);
            placeholder.Controls.Add(order);
            placeholder.Controls.Add(new LiteralControl("<br /><br /><a href=\"order_ticket.aspx\">Back to show list</a>"));
            placeholder.Controls.Add(hiddenShid);
        }
 protected void AgregarControles(Label nombreContr, TextBox txt, DropDownList cmb, HiddenField nhf, int cont)
 {
     try
     {
         /*
         pnlSeleccionarDatos.Controls.Add(nombreContr);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         pnlSeleccionarDatos.Controls.Add(cmb);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         pnlSeleccionarDatos.Controls.Add(txt);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         */
         Panel1.Controls.Add(new LiteralControl("<tr>"));
         Panel1.Controls.Add(new LiteralControl("<td>"));
         Panel1.Controls.Add(nombreContr);
         Panel1.Controls.Add(new LiteralControl("</td><td>"));
         Panel1.Controls.Add(cmb);
         Panel1.Controls.Add(new LiteralControl("</td><td>"));
         Panel1.Controls.Add(txt);
         Panel1.Controls.Add(nhf);
         Panel1.Controls.Add(new LiteralControl("</td></tr>"));
     }
     catch (Exception ex)
     {
         return;
     }
 }
Beispiel #9
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.id = Globals.RequestQueryNum("id");
         if (this.id > 0)
         {
             LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(this.id);
             if (discountInfo != null)
             {
                 this.IsCommision.Checked  = discountInfo.IsCommission;
                 this.discount.Text        = ((double)discountInfo.CommissionDiscount / 10.0).ToString();
                 this.txtActivityName.Text = discountInfo.ActivityName;
                 this.dateBeginTime.Text   = discountInfo.BeginTime.ToString();
                 this.dateEndTime.Text     = discountInfo.EndTime.ToString();
                 this.txtDescription.Text  = discountInfo.Description;
                 this.txtLimitNumber.Text  = discountInfo.LimitNumber.ToString();
                 System.Web.UI.WebControls.HiddenField hiddenField  = this.memberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
                 System.Web.UI.WebControls.HiddenField hiddenField2 = this.memberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
                 System.Web.UI.WebControls.HiddenField hiddenField3 = this.memberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
                 this.memberRange.Grade        = discountInfo.ApplyMembers;
                 this.memberRange.CustomGroup  = discountInfo.CustomGroup;
                 this.memberRange.DefualtGroup = discountInfo.DefualtGroup;
                 hiddenField.Value             = discountInfo.ApplyMembers;
                 hiddenField2.Value            = discountInfo.DefualtGroup;
                 hiddenField3.Value            = discountInfo.CustomGroup;
             }
         }
     }
 }
 private void SageInitPart()
 {
     SetPortalCofig();
     InitializePage();
     LoadModuleControls();          
     IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
     //LoadControl(phdAdministrativBreadCrumb, "~/Controls/ctl_AdminBreadCrum.ascx");
     LoadControl(phdAdminMenu, "~/Controls/ctl_AdminMenuOnly.ascx");
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowFooter) == "1")
     {
         divFooterWrapper.Attributes.Add("style", "display:block;");
     }
     else
     {
         divFooterWrapper.Attributes.Add("style", "display:none;");
     }
     BindModuleControls();
     HiddenField hdnPageID = new HiddenField();
     hdnPageID.ID = "hdnPageID";
     if (HttpContext.Current.Request.QueryString["pgid"] != null)
     {
         hdnPageID.Value = HttpContext.Current.Request.QueryString["pgid"].ToString();
     }
     HiddenField hdnActiveIndex = new HiddenField();
     hdnActiveIndex.ID = "hdnActiveIndex";
     if (HttpContext.Current.Request.QueryString["ActInd"] != null)
     {
         hdnActiveIndex.Value = HttpContext.Current.Request.QueryString["ActInd"].ToString();
     }
     this.Page.Form.Controls.Add(hdnPageID);
     this.Page.Form.Controls.Add(hdnActiveIndex);
     OverridePageInfo(null);
 }
        private void AddCompactCheckBoxField(HtmlGenericControl container)
        {
            using (HtmlGenericControl field = HtmlControlHelper.GetField())
            {
                using (HtmlGenericControl slider = new HtmlGenericControl("div"))
                {
                    slider.Attributes.Add("class", "ui checkbox");

                    using (HtmlInputCheckBox checkBox = new HtmlInputCheckBox())
                    {
                        checkBox.ID = "CompactCheckBox";
                        checkBox.Checked = false;

                        slider.Controls.Add(checkBox);
                        this.isCompactHidden = new HiddenField();
                        this.isCompactHidden.ID = "IsCompactHidden";
                        this.isCompactHidden.Value = "0";

                        slider.Controls.Add(this.isCompactHidden);
                    }

                    using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.ShowCompact))
                    {
                        slider.Controls.Add(label);
                    }

                    field.Controls.Add(slider);
                }

                container.Controls.Add(field);
            }
        }
Beispiel #12
0
        protected override void CreateChildControls()
        {
            HiddenField selected_node = new HiddenField();
            selected_node.ID = "selected-data";
            this.Controls.Add(selected_node);

            if (this.EventMode == true)
            {
                Button button = new Button();
                button.ID = "button";
                button.CssClass = "treebutton hidden";
                button.Click += new EventHandler(button_Click);
                this.Controls.Add(button);

                /*
                HiddenField value = new HiddenField();
                value.ID = "selected-data";
                this.Controls.Add(value);
                 * */
            }

            LiteralControl content = new LiteralControl();
            content.ID = "content";
            this.Controls.Add(content);
        }
Beispiel #13
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
     string[] allKeys = base.Request.Params.AllKeys;
     if (allKeys.Contains("id") && base.Request["id"].ToString().bInt(ref this.eId) && !this.Page.IsPostBack)
     {
         PointExChangeInfo pointExChangeInfo = PointExChangeHelper.Get(this.eId);
         this.txt_name.Text = pointExChangeInfo.Name;
         this.calendarStartDate.SelectedDate = new System.DateTime?(pointExChangeInfo.BeginDate);
         this.calendarEndDate.SelectedDate   = new System.DateTime?(pointExChangeInfo.EndDate);
         this.txt_img.Text = pointExChangeInfo.ImgUrl;
         this.hidpic.Value = pointExChangeInfo.ImgUrl;
         System.Web.UI.WebControls.HiddenField hiddenField  = this.SetMemberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField2 = this.SetMemberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField3 = this.SetMemberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
         this.SetMemberRange.Grade        = pointExChangeInfo.MemberGrades;
         this.SetMemberRange.DefualtGroup = pointExChangeInfo.DefualtGroup;
         this.SetMemberRange.CustomGroup  = pointExChangeInfo.CustomGroup;
         hiddenField.Value  = pointExChangeInfo.MemberGrades;
         hiddenField2.Value = pointExChangeInfo.DefualtGroup;
         hiddenField3.Value = pointExChangeInfo.CustomGroup;
         if (pointExChangeInfo.EndDate < System.DateTime.Now)
         {
             this.bFinished = true;
             return;
         }
         this.bFinished = false;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Request.Cookies.Clear();
            mnuMain.Items.Clear();
            m_User = (UserObject)Session["User"];

            if (m_User != null)
            {
                lblLoggedInAs.Visible = true;
                lblLoggedInAs.Text = string.Concat(GetLocalResourceObject("LoggedInAs"), " ", m_User.UserName, "    |    ");
                linkLogout.Visible = true;
                lblVersion.Visible = true;
                lblVersion.Text = ConfigurationManager.AppSettings["version"];
                if (MenuList == null)
                    FetchMenu();
                BuildMenu(mnuMain, dsMenuItems);
                Session["User"] = m_User;
				
            }

            HiddenField field = new HiddenField
            {
                ID = "SessionID",
                Value = Session.SessionID
            };
            Page.Form.Controls.Add(field);
            lblError.Text = "";
        }
Beispiel #15
0
        protected void agregarFiltro(string nombre)
        {
            try
            {
                Label campoSel = new Label();
                campoSel.Text = nombre;
                //arregloLabels[numeroRegistro] = campoSel;

                TextBox nuevoTxt = new TextBox();
                nuevoTxt.ID = "txt" + nombre;
                nuevoTxt.Width = 100;
                //arregloTextBoxs[numeroRegistro] = nuevoTxt;
                DropDownList nuevoCmb = new DropDownList();
                nuevoCmb.ID = "cmb" + nombre;
                nuevoCmb.Items.Add("--Seleccione operador--");
                nuevoCmb.Items.Add("<");
                nuevoCmb.Items.Add(">");
                nuevoCmb.Items.Add(">=");
                nuevoCmb.Items.Add("<=");
                nuevoCmb.Items.Add("=");
                nuevoCmb.Items.Add("<>");
                nuevoCmb.SelectedIndex = 0;
                //arregloCombos[numeroRegistro] = nuevoCmb;
                HiddenField nuevoHidF = new HiddenField();
                nuevoHidF.ID = "hdf" + nombre;
                nuevoHidF.Value = nombre;
                AgregarControles(campoSel, nuevoTxt, nuevoCmb, nuevoHidF, 0);
                //contadorControles++;
            }
            catch (Exception ex)
            {
                return;
            }
        }
		public DemoServerControl()
		{
			this.astvMyTree = new ASTreeView();
			this.hfSelectedNodeText = new HiddenField();
			this.hfSelectedNodeValue = new HiddenField();
			this.btnPostBackTrigger = new Button();
		}
Beispiel #17
0
 public Imagem(FileUpload FileUpload, HiddenField Hidden, string Path, string Arquivo)
 {
     this.FileUpload = FileUpload;
     this.Hidden = Hidden;
     this.Path = Path;
     this.Arquivo = Arquivo;
 }
Beispiel #18
0
 protected void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         int    num  = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Depth");
         string text = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Name").ToString();
         if (num == 1)
         {
             text = "<b>" + text + "</b>";
         }
         else
         {
             System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = e.Item.FindControl("spShowImage") as System.Web.UI.HtmlControls.HtmlGenericControl;
             htmlGenericControl.Visible = false;
         }
         for (int i = 1; i < num; i++)
         {
             text = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + text;
         }
         System.Web.UI.WebControls.Literal literal = e.Item.FindControl("lblCategoryName") as System.Web.UI.WebControls.Literal;
         literal.Text = text;
         System.Web.UI.WebControls.HiddenField hiddenField = e.Item.FindControl("hdfCategoryID") as System.Web.UI.WebControls.HiddenField;
         hiddenField.Value = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "CategoryID").ToString();
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:TreeViewAdapter"/> class.
 /// </summary>
 public TreeViewAdapter()
 {
     if (_viewState == null)
     {
         _viewState = new HiddenField();
     }
 }
Beispiel #20
0
    protected void Page_LoadMain(object sender, EventArgs e)
    {
        // Place page-specific code here.
        antiforgery = this.FindControl("antiforgery") as System.Web.UI.WebControls.HiddenField;

        if (!this.IsPostBack)
        {
            Guid antiforgeryToken = Guid.NewGuid();
            this.Session["AntiforgeryToken"] = antiforgeryToken;

            antiforgery = this.FindControl("antiforgery") as System.Web.UI.WebControls.HiddenField;

            if (antiforgery != null)
            {
                antiforgery.Value = antiforgeryToken.ToString();
            }
        }
        else
        {
            Guid stored = (Guid)this.Session["AntiforgeryToken"];
            Guid sent   = new Guid(antiforgery.Value);
            if (sent != stored)
            {
                throw new Exception("XSRF Attack Detected!");
            }
        }


        if (!InValidAccess())
        {
            this.RegisterClientScriptBlock("Invalid Access", "<script>alert('Invalid Access')<script>");
            Response.Redirect(this.ResolveUrl("~/UI/Index.aspx"));
        }
    }
        protected override void OnInit(EventArgs e)
        {
            if (KPColumnsModel != null)
            {

                HtmlGenericControl htmlWindow = new HtmlGenericControl("div");
                htmlWindow.Attributes.Add("class", "KPWindow KPFormWindow KPFormZoom");

                #region Hidden Key
                HiddenKey = new HiddenField();
                HiddenKey.ID = String.Format("hiddenKey_{0}", ZoomConfig.ZoomID);
                #endregion Hidden Key

                htmlWindow.Controls.Add(GenerateTitle(ZoomConfig.WindowTitle));
                htmlWindow.Controls.Add(HiddenKey);

                #region Zoom Content
                tableID = String.Concat(this.ClientID, "GridTable");
                pagerID = String.Concat(this.ClientID, "GridPager");

                HtmlGenericControl htmlContent = new HtmlGenericControl("div");
                htmlContent.Attributes.Add("class", "Content");

                HtmlGenericControl htmlTable = new HtmlGenericControl("table");
                htmlTable.Attributes.Add("id", tableID);

                HtmlGenericControl htmlPager = new HtmlGenericControl("div");
                htmlPager.Attributes.Add("id", pagerID);

                htmlContent.Controls.Add(htmlTable);
                htmlContent.Controls.Add(htmlPager);

                #endregion

                htmlWindow.Controls.Add(htmlContent);

                #region Zoom Action Bar
                HtmlGenericControl htmlKPActionBar = new HtmlGenericControl("div");
                htmlKPActionBar.Attributes.Add("class", "KPActionBar");

                Button btnOK = new Button()
                {
                    ID = String.Format("KPGridControlBtnOK_{0}", ZoomConfig.ZoomID),
                    Text = KPGlobalizationLanguage.GetString("KPComponents_Select"),
                    CssClass = "KPZoomSelectButton"
                };
                btnOK.Attributes.Add("onclick", "return  validateGridSelection(event, '" + tableID + "', true, true);");
                btnOK.Click += new EventHandler(btnOK_Click);

                htmlKPActionBar.Controls.Add(btnOK);
                #endregion

                htmlWindow.Controls.Add(htmlKPActionBar);

                this.Controls.Add(htmlWindow);

            }
            base.OnInit(e);
        }
Beispiel #22
0
 protected void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.HiddenField hiddenField = e.Item.FindControl("hdfMessageType") as System.Web.UI.WebControls.HiddenField;
         hiddenField.Value = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "MessageType").ToString();
     }
 }
Beispiel #23
0
 private void AddHiddenField(Panel p, string id)
 {
     using (HiddenField hidden = new HiddenField())
     {
         hidden.ID = id;
         p.Controls.Add(hidden);
     }
 }
Beispiel #24
0
        private void AddEmailHidden(HtmlGenericControl p)
        {
            this.emailHidden = new HiddenField();
            this.emailHidden.ID = "EmailHidden";
            this.emailHidden.ClientIDMode = ClientIDMode.Static;

            p.Controls.Add(this.emailHidden);
        }
Beispiel #25
0
 protected virtual void BaseLoad_GEN(object sender, System.EventArgs e)
 {
     System.Web.UI.WebControls.HiddenField c = (System.Web.UI.WebControls.HiddenField)BaseClasses.Utils.MiscUtils.FindControlRecursively(this as BaseApplicationRecordControl, this.ID + "_PostbackTracker");
     if (c != null)
     {
         c.ValueChanged += Postback;
     }
 }
Beispiel #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileUploader" /> class.
 /// </summary>
 public FileUploader()
     : base()
 {
     RequiredFieldValidator = new HiddenFieldValidator();
     HelpBlock = new HelpBlock();
     _hfBinaryFileId = new HiddenField();
     _hfBinaryFileTypeGuid = new HiddenField();
 }
Beispiel #27
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            string text = this.txtActivityName.Text;

            System.DateTime?textToDate  = this.dateBeginTime.TextToDate;
            System.DateTime?textToDate2 = this.dateEndTime.TextToDate;
            string          text2       = this.txtDescription.Text;
            int             limitNumber = 0;

            System.Web.UI.WebControls.HiddenField hiddenField  = this.memberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
            System.Web.UI.WebControls.HiddenField hiddenField2 = this.memberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
            System.Web.UI.WebControls.HiddenField hiddenField3 = this.memberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("活动名称不能为空!", false);
                return;
            }
            if (!textToDate.HasValue || !textToDate2.HasValue)
            {
                this.ShowMsg("开始时间和结束时间都不能为空!", false);
                return;
            }
            if (textToDate.Value >= textToDate2.Value)
            {
                this.ShowMsg("开始时间不能大于或等于结束时间!", false);
                return;
            }
            if (!int.TryParse(this.txtLimitNumber.Text, out limitNumber))
            {
                this.ShowMsg("每人限购格式不对!", false);
                return;
            }
            if (hiddenField.Value == "-1" && hiddenField2.Value == "-1" && hiddenField3.Value == "-1")
            {
                this.ShowMsg("请选择适用会员!", false);
                return;
            }
            LimitedTimeDiscountInfo limitedTimeDiscountInfo = new LimitedTimeDiscountInfo();

            limitedTimeDiscountInfo.ActivityName = text;
            limitedTimeDiscountInfo.BeginTime    = textToDate.Value;
            limitedTimeDiscountInfo.EndTime      = textToDate2.Value;
            limitedTimeDiscountInfo.Description  = text2;
            limitedTimeDiscountInfo.LimitNumber  = limitNumber;
            limitedTimeDiscountInfo.ApplyMembers = hiddenField.Value;
            limitedTimeDiscountInfo.DefualtGroup = hiddenField2.Value;
            limitedTimeDiscountInfo.CustomGroup  = hiddenField3.Value;
            limitedTimeDiscountInfo.CreateTime   = System.DateTime.Now;
            limitedTimeDiscountInfo.Status       = 1.ToString();
            int num = Globals.RequestQueryNum("id");

            if (num > 0)
            {
                limitedTimeDiscountInfo.LimitedTimeDiscountId = num;
                LimitedTimeDiscountHelper.UpdateLimitedTimeDiscount(limitedTimeDiscountInfo);
            }
            this.ShowMsgAndReUrl("保存成功!", true, "EditLimitedTimeDiscount.aspx?id=" + Globals.RequestQueryNum("id"));
        }
Beispiel #28
0
 public static void FillPeoplePickerValue(HiddenField peoplePickerHiddenField, Microsoft.SharePoint.Client.User[] users)
 {
     List<PeoplePickerUser> peoplePickerUsers = new List<PeoplePickerUser>();
     foreach (var user in users)
     {
         peoplePickerUsers.Add(new PeoplePickerUser() { Name = user.Title, Email = user.Email, Login = user.LoginName });
     }
     peoplePickerHiddenField.Value = JsonHelper.Serialize<List<PeoplePickerUser>>(peoplePickerUsers);
 }
        /// <summary>
        /// Initializes the controls part of your template.
        /// </summary>
        /// <param name="container">Template container for all controls.</param>
        /// <remarks>
        /// Initialize your controls in this method. Do not override CreateChildControls method.
        /// </remarks>
        protected override void InitializeControls(GenericContainer container)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            List<Hashtable> images = this.GetImages();
            string serializedCollection = serializer.Serialize(images);

            this.imagesField = container.GetControl<HiddenField>("imagesField", true);
            this.imagesField.Value = serializedCollection;
        }
        private void CreateHiddenFields(Control container)
        {
            using (HiddenField uploadedFilesHidden = new HiddenField())
            {
                uploadedFilesHidden.ID = "UploadedFilesHidden";

                container.Controls.Add(uploadedFilesHidden);
            }
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);

			// Create hidden control for storage
			storage = new HiddenField();
			storage.ID = "storage";			
			Controls.Add(storage);
		}
 public static void FillPeoplePickerValue(HiddenField peoplePickerHiddenField, Microsoft.SharePoint.Client.User[] users)
 {
     List<O365User> O365Users = new List<O365User>();
     foreach (var user in users)
     {
         O365Users.Add(new O365User() { Name = user.Title, Email = user.Email, Login = user.LoginName });
     }
     peoplePickerHiddenField.Value = JsonConvert.SerializeObject(O365Users);
 }
Beispiel #33
0
        protected void btnSaveAndNext_Click(object sender, System.EventArgs e)
        {
            string text = this.txtActivityName.Text;

            System.DateTime?textToDate  = this.dateBeginTime.TextToDate;
            System.DateTime?textToDate2 = this.dateEndTime.TextToDate;
            string          text2       = this.txtDescription.Text;
            int             limitNumber = 0;

            System.Web.UI.WebControls.HiddenField hiddenField  = this.memberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
            System.Web.UI.WebControls.HiddenField hiddenField2 = this.memberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
            System.Web.UI.WebControls.HiddenField hiddenField3 = this.memberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("活动名称不能为空!", false);
                return;
            }
            if (!textToDate.HasValue || !textToDate2.HasValue)
            {
                this.ShowMsg("开始时间和结束时间都不能为空!", false);
                return;
            }
            if (textToDate.Value >= textToDate2.Value)
            {
                this.ShowMsg("开始时间不能大于或等于结束时间!", false);
                return;
            }
            if (!int.TryParse(this.txtLimitNumber.Text, out limitNumber))
            {
                this.ShowMsg("每人限购格式不对!", false);
                return;
            }
            if (hiddenField.Value == "-1" && hiddenField2.Value == "-1" && hiddenField3.Value == "-1")
            {
                this.ShowMsg("请选择适用会员!", false);
                return;
            }
            int num = LimitedTimeDiscountHelper.AddLimitedTimeDiscount(new LimitedTimeDiscountInfo
            {
                ActivityName = text,
                BeginTime    = textToDate.Value,
                EndTime      = textToDate2.Value,
                Description  = text2,
                LimitNumber  = limitNumber,
                ApplyMembers = hiddenField.Value,
                DefualtGroup = hiddenField2.Value,
                CustomGroup  = hiddenField3.Value,
                CreateTime   = System.DateTime.Now,
                Status       = 1.ToString()
            });

            if (num > 0)
            {
                this.ShowMsgAndReUrl("添加成功", true, "LimitedTimeDiscountAddProduct.aspx?id=" + num);
            }
        }
Beispiel #34
0
        private void AddHiddenControls(Panel p)
        {
            reportHidden = new HiddenField();
            reportHidden.ID = "ReportHidden";
            p.Controls.Add(reportHidden);

            reportTitleHidden = new HiddenField();
            reportTitleHidden.ID = "ReportTitleHidden";
            p.Controls.Add(reportTitleHidden);
        }
Beispiel #35
0
 protected void getReviews(HiddenField hidnValue, HyperLink hlReviews)
 {
     Guid storyID = new Guid();
     storyID = new Guid(hidnValue.Value);
     Guid chapID = new Guid();
     Chapter chap = new Chapter();
     chap = chap.GetFirstByStoryID(storyID);
     chapID = chap.Id;
     String navUrl = "~/ReviewsPage.aspx?ChapterID=" + chapID + "&StoryID=" + storyID;
     hlReviews.NavigateUrl = navUrl;
 }
Beispiel #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Email" /> class.
 /// </summary>
 public Email()
 {
     tbFromName = new RockTextBox();
     tbFromAddress = new RockTextBox();
     tbReplyToAddress = new RockTextBox();
     tbSubject = new RockTextBox();
     htmlMessage = new HtmlEditor();
     tbTextMessage = new RockTextBox();
     hfAttachments = new HiddenField();
     fuAttachments = new FileUploader();
 }
Beispiel #37
0
        /// <summary>
        /// Creates HiddenField child control.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            HiddenField hiddenField = new HiddenField();
            hiddenField.EnableViewState = true;
            hiddenField.ID = String.Concat(ClientInstanceName, "HiddenField");

            Controls.Add(hiddenField);

            SelectedValueHiddenField = hiddenField;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageCheckBox"/> class.
        /// </summary>
        public ImageCheckBox()
        {
            _hidValue = new HiddenField();
            _hidValue.ID = "hidValue";

            _hidCheckState = new HiddenField();
            _hidCheckState.ID = "hidCheckState";

            _imgCheck = new Image();
            _imgCheck.ID = "imgCheck";

            this.Attributes["class"] = "checkbox";
        }
Beispiel #39
0
        protected override void OnInit(EventArgs e)
        {
            StringBuilder styleValueInner = new StringBuilder();

            if (string.IsNullOrEmpty(width))
            {
                width = "300";
            }

            width = width.Replace("px", "");

            styleValueInner.AppendFormat("width: 99%; ");

            if (string.IsNullOrEmpty(height))
            {
                height = "300";
            }

            height = height.Replace("px", "");

            styleValueInner.AppendFormat("height:{0}px; ", int.Parse(height) - 80);
            styleValueInner.Append("margin-top: 5px;");

            var bodyDiv = new HtmlGenericControl("div");

            bodyDiv.Attributes.Add("class", "chartcontainer");
            bodyDiv.Attributes.Add("style", styleValueInner.ToString());
            this.Controls.Add(bodyDiv);

            var footP = new HtmlGenericControl("p");

            footP.Attributes.Add("class", "footerInfo");
            footP.Attributes.Add("style", "height: 20px; margin: 10 0 0;");
            this.Controls.Add(footP);

            var hdnArea = new System.Web.UI.WebControls.HiddenField();

            hdnArea.ID    = "hdnArea";
            hdnArea.Value = "";
            this.Controls.Add(hdnArea);

            if (showtableonclick)
            {
                var modal = new Modal();
                modal.ID        = string.Concat(this.ID, "_modal");
                modal.BtnFechar = true;

                this.Controls.Add(modal);
            }
        }
Beispiel #40
0
 /// <summary>
 /// 添加行政管理检查内容
 /// </summary>
 private void GetGvManageCheck(string manageCheckId)
 {
     for (int i = 0; i < this.Grid1.Rows.Count; i++)
     {
         Model.Administrative_ManageCheckItem  manageCheckItem = new Model.Administrative_ManageCheckItem();
         System.Web.UI.WebControls.HiddenField hdCheckTypeCode = (System.Web.UI.WebControls.HiddenField)(this.Grid1.Rows[i].FindControl("hdCheckTypeCode"));
         string isCheck = ((System.Web.UI.WebControls.DropDownList)(this.Grid1.Rows[i].FindControl("drpIsCheck"))).SelectedValue;
         manageCheckItem.ManageCheckId     = manageCheckId;
         manageCheckItem.CheckTypeCode     = hdCheckTypeCode.Value;
         manageCheckItem.IsCheck           = Convert.ToBoolean(isCheck);
         manageCheckItem.ManageCheckItemId = SQLHelper.GetNewID(typeof(Model.Administrative_ManageCheckItem));
         BLL.ManageCheckItemService.AddManageCheckItem(manageCheckItem);
     }
 }
Beispiel #41
0
        protected void agregarVisitante(string idUS, string nombre, string idAgenda, string hrReg, string observ)
        {
            try
            {
                Label campoSel = new Label();
                campoSel.Text = nombre;

                CheckBox chB = new CheckBox();

                chB.ID = "-checkId-" + idUS + "-" + idAgenda; ;

                TextBox tBox = new TextBox();
                tBox.ID = "txtBox" + idUS;
                tBox.CssClass = "boxLeft";

                HiddenField nuevoHidF = new HiddenField();
                nuevoHidF.ID = "hdf" + nombre;
                nuevoHidF.Value = nombre;

                Label lhrReg = null;
                Label lobserv = null;

                if (hrReg == null || hrReg.ToUpper() == "NULL" || hrReg == "")
                {
                    lhrReg = null;
                }
                else
                {
                    lhrReg = new Label();
                    lobserv = new Label();
                    lhrReg.Text = hrReg;
                    if(observ == null || observ.ToUpper() == "NULL" || observ == "")
                    {
                        lobserv.Text = "";
                    }
                    else
                    {
                        lobserv.Text = observ;
                    }
                }

                AgregarControles(campoSel, chB, tBox, nuevoHidF, lhrReg, lobserv);
                //contadorControles++;
            }
            catch (Exception ex)
            {
                return;
            }
        }
        protected override void EnsureControls()
        {
            if (ViewMode == FormControlViewMode.Editor)
            {
                if (_hiddenGuid == null)
                {
                    _hiddenGuid = new HiddenField { ID = string.Format("hidden_guid{0}", ID) };
                }

                if (string.IsNullOrEmpty(_hiddenGuid.Value))
                {
                    _hiddenGuid.Value = Guid.NewGuid().ToString();
                }
            }
        }
Beispiel #43
0
 /// <summary>
 /// Grid绑定行
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
 {
     for (int i = 0; i < this.Grid1.Rows.Count; i++)
     {
         System.Web.UI.WebControls.HiddenField  hdIsCheck  = (System.Web.UI.WebControls.HiddenField)(this.Grid1.Rows[i].FindControl("hdIsCheck"));
         System.Web.UI.WebControls.DropDownList drpIsCheck = (System.Web.UI.WebControls.DropDownList)(this.Grid1.Rows[i].FindControl("drpIsCheck"));
         if (hdIsCheck.Value == "True")
         {
             drpIsCheck.SelectedValue = "True";
         }
         else
         {
             drpIsCheck.SelectedValue = "False";
         }
     }
 }
        protected void SaveButtonClick(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = GenerateTable();


                foreach (GridViewRow rows in gv_misc.Rows)
                {
                    System.Web.UI.WebControls.TextBox txtbox = (System.Web.UI.WebControls.TextBox)rows.FindControl("gv_misc_desc");
                    string a = txtbox.Text;
                    if (a != "")
                    {
                        var row = dt.NewRow();
                        dt.Rows.Add(row);
                        System.Web.UI.WebControls.TextBox txtbox1 = (System.Web.UI.WebControls.TextBox)rows.FindControl("gv_misc_desc");
                        string a1 = txtbox1.Text;
                        System.Web.UI.WebControls.TextBox txtbox2 = (System.Web.UI.WebControls.TextBox)rows.FindControl("gv_misc_amt");
                        string a2 = txtbox2.Text;
                        System.Web.UI.WebControls.TextBox txtbox3 = (System.Web.UI.WebControls.TextBox)rows.FindControl("gv_misc_size");
                        string a3 = txtbox3.Text;
                        System.Web.UI.WebControls.HiddenField txtbox4 = (System.Web.UI.WebControls.HiddenField)rows.FindControl("gv_misc_id");
                        string a4 = txtbox4.Value;
                        System.Web.UI.WebControls.DropDownList txtbox5 = (System.Web.UI.WebControls.DropDownList)rows.FindControl("gv_misc_ddlccround");
                        string a5 = txtbox5.SelectedValue;

                        row["MMISCDESCR"] = a1;
                        row["MMISCQTY"]   = a2;
                        row["MMISCSIZE"]  = a3;
                        row["MD_ID"]      = a4.TrimEnd();
                        row["CCROUND"]    = a5;
                    }
                }



                Update(dt);

                gvBind();
                this.Response.Redirect(this.Request.Url.ToString());
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #45
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         for (int i = 1; i <= 10; i++)
         {
             this.ddl_maxNum.Items.Add(new System.Web.UI.WebControls.ListItem("每人参与" + i.ToString() + "次", i.ToString()));
         }
         this.ddl_maxNum.Items.Add(new System.Web.UI.WebControls.ListItem("不限", "0"));
         this.hasPartProductAct = ActivityHelper.HasPartProductAct();
     }
     this.IsView = Globals.RequestQueryNum("View");
     string[] allKeys = base.Request.Params.AllKeys;
     if (allKeys.Contains("id") && base.Request["id"].ToString().bInt(ref this._id))
     {
         this._act = ActivityHelper.GetAct(this._id);
         if (this._act == null)
         {
             this.ShowMsg("没有这个满减活动~", false);
         }
         if (this._act.StartTime < System.DateTime.Now)
         {
             this.IsView = 1;
         }
         this.txt_name.Text = this._act.ActivitiesName;
         this.calendarStartDate.SelectedDate = new System.DateTime?(this._act.StartTime);
         this.calendarEndDate.SelectedDate   = new System.DateTime?(this._act.EndTime);
         this.ddl_maxNum.SelectedValue       = this._act.attendTime.ToString();
         this._json        = JsonConvert.SerializeObject(this._act.Details);
         this.isAllProduct = this._act.isAllProduct;
         System.Web.UI.WebControls.HiddenField hiddenField  = this.SetMemberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField2 = this.SetMemberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField3 = this.SetMemberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
         this.SetMemberRange.Grade        = this._act.MemberGrades;
         this.SetMemberRange.DefualtGroup = this._act.DefualtGroup;
         this.SetMemberRange.CustomGroup  = this._act.CustomGroup;
         hiddenField.Value  = this._act.MemberGrades;
         hiddenField2.Value = this._act.DefualtGroup;
         hiddenField3.Value = this._act.CustomGroup;
         System.Data.DataTable dataTable = ActivityHelper.QueryProducts(this._id);
         this.productCount.InnerText = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0");
     }
 }
Beispiel #46
0
 protected override void AttachChildControls()
 {
     this.txtSKU                                 = (System.Web.UI.WebControls.TextBox) this.FindControl("txtSKU");
     this.btnSKU                                 = (System.Web.UI.WebControls.Button) this.FindControl("btnSKU");
     this.btnClearCart                           = (ImageLinkButton)this.FindControl("btnClearCart");
     this.shoppingCartProductList                = (Common_ShoppingCart_ProductList)this.FindControl("Common_ShoppingCart_ProductList");
     this.shoppingCartGiftList                   = (Common_ShoppingCart_GiftList)this.FindControl("Common_ShoppingCart_GiftList");
     this.shoppingCartPromoGiftList              = (Common_ShoppingCart_PromoGiftList)this.FindControl("Common_ShoppingCart_PromoGiftList");
     this.lblTotalPrice                          = (FormatedMoneyLabel)this.FindControl("lblTotalPrice");
     this.lblAmoutPrice                          = (System.Web.UI.WebControls.Literal) this.FindControl("lblAmoutPrice");
     this.lblTax                                 = (System.Web.UI.WebControls.Literal) this.FindControl("lblTax");
     this.lblReducedActivity                     = (System.Web.UI.WebControls.Literal) this.FindControl("lblReducedActivity");
     this.hlkReducedPromotion                    = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion");
     this.btnCheckout                            = (System.Web.UI.WebControls.Button) this.FindControl("btnCheckout");
     this.pnlShopCart                            = (System.Web.UI.WebControls.Panel) this.FindControl("pnlShopCart");
     this.pnlPromoGift                           = (System.Web.UI.WebControls.Panel) this.FindControl("pnlPromoGift");
     this.pnlNoProduct                           = (System.Web.UI.WebControls.Panel) this.FindControl("pnlNoProduct");
     this.hfdIsLogin                             = (System.Web.UI.WebControls.HiddenField) this.FindControl("hfdIsLogin");
     this.btnSKU.Click                          += new System.EventHandler(this.btnSKU_Click);
     this.btnClearCart.Click                    += new System.EventHandler(this.btnClearCart_Click);
     this.shoppingCartProductList.ItemCommand   += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartProductList_ItemCommand);
     this.shoppingCartProductList.ItemDataBound += shoppingCartProductList_ItemDataBound;
     this.shoppingCartGiftList.ItemCommand      += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_ItemCommand);
     this.shoppingCartGiftList.FreeItemCommand  += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_FreeItemCommand);
     this.shoppingCartPromoGiftList.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.shoppingCartPromoGiftList_ItemCommand);
     this.btnCheckout.Click                     += new System.EventHandler(this.btnCheckout_Click);
     shoppingCart                                = ShoppingCartProcessor.GetShoppingCart();
     if (!HiContext.Current.SiteSettings.IsOpenSiteSale)
     {
         this.btnSKU.Visible      = false;
         this.btnCheckout.Visible = false;
     }
     if (!HiContext.Current.User.IsAnonymous)
     {
         this.hfdIsLogin.Value = "logined";
     }
     System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
     sw.Start();
     this.BindShoppingCart();
     sw.Stop();
     ErrorLog.Write("PC端购物车加载所用的时间(毫秒):" + sw.ElapsedMilliseconds.ToString());
 }
Beispiel #47
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            bool flag  = true;
            bool flag2 = true;

            foreach (System.Web.UI.WebControls.DataListItem item in this.photoDataList.Controls)
            {
                System.Web.UI.WebControls.CheckBox    box   = (System.Web.UI.WebControls.CheckBox)item.FindControl("checkboxCol");
                System.Web.UI.WebControls.HiddenField field = (System.Web.UI.WebControls.HiddenField)item.FindControl("HiddenFieldImag");
                if (box != null && box.Checked)
                {
                    flag2 = false;
                    try
                    {
                        int photoId = (int)this.photoDataList.DataKeys[item.ItemIndex];
                        StoreHelper.DeleteImage(field.Value);
                        if (!GalleryHelper.DeletePhoto(photoId))
                        {
                            flag = false;
                        }
                    }
                    catch
                    {
                        this.ShowMsg("删除文件错误", false);
                        this.BindImageData();
                    }
                }
            }
            if (flag2)
            {
                this.ShowMsg("未选择删除的图片", false);
            }
            else
            {
                if (flag)
                {
                    this.ShowMsg("删除图片成功", true);
                }
                this.BindImageData();
            }
        }
Beispiel #48
0
        private bool completarCampos(string historiaLaboralID)
        {
            int i = System.Convert.ToInt32(historiaLaboralID);

            historiaLaboralID = i.ToString();
            Conexion conn = new Conexion();

            conn.Sql = "SELECT * FROM " + tabla + "historiaLaboral WHERE historiaLaboralID = '" + historiaLaboralID + "';";
            conn.leer(null);
            Trace.Write(conn.Sql);
            if (conn.registro())
            {
                rangoRenta.DataBind();
                this.historiaLaboralID.Value = historiaLaboralID;
                cargo.Text               = conn.Dr["cargo"].ToString();
                empresa.Text             = conn.Dr["empresa"].ToString();
                responsabilidades.Text   = conn.Dr["responsabilidades"].ToString();
                desdeAnio.SelectedIndex  = desdeAnio.Items.IndexOf(desdeAnio.Items.FindByValue(conn.Dr["desdeAnio"].ToString()));
                desdeMes.SelectedIndex   = desdeMes.Items.IndexOf(desdeMes.Items.FindByValue(conn.Dr["desdeMes"].ToString()));
                rangoRenta.SelectedIndex = rangoRenta.Items.IndexOf(rangoRenta.Items.FindByValue(conn.Dr["rangoRentaID"].ToString()));
                diractualLaboral.Text    = conn.Dr["calle"].ToString();
                comunaLaboral.Text       = conn.Dr["comuna"].ToString();
                ciudadactLaboral.Text    = conn.Dr["ciudad"].ToString();
                if (conn.Dr["hastaAnio"].ToString() != "-1" && conn.Dr["hastaMes"].ToString() != "-1")
                {
                    hastaAnio.SelectedIndex = hastaAnio.Items.IndexOf(hastaAnio.Items.FindByValue(conn.Dr["hastaAnio"].ToString()));
                    hastaMes.SelectedIndex  = hastaMes.Items.IndexOf(hastaMes.Items.FindByValue(conn.Dr["hastaMes"].ToString()));
                    trabajando.Checked      = false;
                }
                else
                {
                    trabajando.Checked = true;
                }
                conn.Cerrar();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Beispiel #49
0
 protected void rptAdminUserList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.HiddenField hiddenField = e.Item.FindControl("hdfAutoID") as System.Web.UI.WebControls.HiddenField;
         hiddenField.Value = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "AutoID").ToString();
         e.Item.FindControl("lbMsgList");
         System.Web.UI.WebControls.CheckBox checkBox  = e.Item.FindControl("cbMsg1") as System.Web.UI.WebControls.CheckBox;
         System.Web.UI.WebControls.CheckBox checkBox2 = e.Item.FindControl("cbMsg2") as System.Web.UI.WebControls.CheckBox;
         System.Web.UI.WebControls.CheckBox checkBox3 = e.Item.FindControl("cbMsg3") as System.Web.UI.WebControls.CheckBox;
         System.Web.UI.WebControls.CheckBox checkBox4 = e.Item.FindControl("cbMsg4") as System.Web.UI.WebControls.CheckBox;
         System.Web.UI.WebControls.CheckBox checkBox5 = e.Item.FindControl("cbMsg5") as System.Web.UI.WebControls.CheckBox;
         System.Web.UI.WebControls.CheckBox checkBox6 = e.Item.FindControl("cbMsg6") as System.Web.UI.WebControls.CheckBox;
         checkBox.Checked  = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg1").ToString() == "1");
         checkBox2.Checked = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg2").ToString() == "1");
         checkBox3.Checked = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg3").ToString() == "1");
         checkBox4.Checked = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg4").ToString() == "1");
         checkBox5.Checked = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg5").ToString() == "1");
         checkBox6.Checked = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Msg6").ToString() == "1");
     }
 }
        protected void BtnShow_Click(object sender, EventArgs e)
        {
            double?discount = null;

            //刷新gridview文本框的值
            if (string.IsNullOrEmpty(tbDiscount.Text.Trim()))
            {
                MessageBoxShow("请先填写折扣率!"); return;
            }

            try
            {
                discount = Convert.ToDouble(tbDiscount.Text.Trim());
                if (discount <= 0 || discount > 1)
                {
                    throw new Exception();
                }
            }
            catch (Exception)
            {
                MessageBoxShow("折扣率输入只能输入(0-1]之间的数字!"); return;
            }
            double num = 0;

            for (int i = 0; i < gvList.Rows.Count; i++)
            {
                System.Web.UI.WebControls.TextBox     tbxFinalprice = (System.Web.UI.WebControls.TextBox)gvList.Rows[i].FindControl("tbxFinalprice");
                System.Web.UI.WebControls.HiddenField HF_Finalprice = (System.Web.UI.WebControls.HiddenField)gvList.Rows[i].FindControl("HF_Finalprice");
                if (!string.IsNullOrEmpty(tbxFinalprice.Text))
                {
                    string lb = HF_Finalprice.Value;
                    tbxFinalprice.Text    = Convert.ToString(double.Parse(lb) * discount);
                    tbxFinalprice.ToolTip = tbxFinalprice.Text;
                    num += Convert.ToDouble(tbxFinalprice.Text);
                }
            }
            tbxModifytotalprice.Text = num.ToString();
            gvList.UpdateTemplateFields();
        }
Beispiel #51
0
 protected override void AttachChildControls()
 {
     this.txtSKU                                 = (System.Web.UI.WebControls.TextBox) this.FindControl("txtSKU");
     this.btnSKU                                 = (System.Web.UI.WebControls.Button) this.FindControl("btnSKU");
     this.btnClearCart                           = (ImageLinkButton)this.FindControl("btnClearCart");
     this.shoppingCartProductList                = (Common_ShoppingCart_ProductList)this.FindControl("Common_ShoppingCart_ProductList");
     this.shoppingCartGiftList                   = (Common_ShoppingCart_GiftList)this.FindControl("Common_ShoppingCart_GiftList");
     this.shoppingCartPromoGiftList              = (Common_ShoppingCart_PromoGiftList)this.FindControl("Common_ShoppingCart_PromoGiftList");
     this.lblTotalPrice                          = (FormatedMoneyLabel)this.FindControl("lblTotalPrice");
     this.lblAmoutPrice                          = (System.Web.UI.WebControls.Literal) this.FindControl("lblAmoutPrice");
     this.hlkReducedPromotion                    = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion");
     this.btnCheckout                            = (System.Web.UI.WebControls.Button) this.FindControl("btnCheckout");
     this.pnlShopCart                            = (System.Web.UI.WebControls.Panel) this.FindControl("pnlShopCart");
     this.pnlPromoGift                           = (System.Web.UI.WebControls.Panel) this.FindControl("pnlPromoGift");
     this.litNoProduct                           = (System.Web.UI.WebControls.Literal) this.FindControl("litNoProduct");
     this.hfdIsLogin                             = (System.Web.UI.WebControls.HiddenField) this.FindControl("hfdIsLogin");
     this.btnSKU.Click                          += new System.EventHandler(this.btnSKU_Click);
     this.btnClearCart.Click                    += new System.EventHandler(this.btnClearCart_Click);
     this.shoppingCartProductList.ItemCommand   += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartProductList_ItemCommand);
     this.shoppingCartGiftList.ItemCommand      += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_ItemCommand);
     this.shoppingCartGiftList.FreeItemCommand  += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_FreeItemCommand);
     this.shoppingCartPromoGiftList.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.shoppingCartPromoGiftList_ItemCommand);
     this.btnCheckout.Click                     += new System.EventHandler(this.btnCheckout_Click);
     if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsOpenSiteSale && !Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings)
     {
         this.btnSKU.Visible      = false;
         this.btnCheckout.Visible = false;
     }
     if (!this.Page.IsPostBack)
     {
         this.BindShoppingCart();
     }
     if (!Hidistro.Membership.Context.HiContext.Current.User.IsAnonymous)
     {
         this.hfdIsLogin.Value = "logined";
     }
 }
Beispiel #52
0
        protected void RepeaterCat_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            System.Web.UI.WebControls.HiddenField hdfCode = e.Item.FindControl("hfdCode") as System.Web.UI.WebControls.HiddenField;
            Repeater repeaterCat = e.Item.FindControl("RepeaterCatN") as Repeater;
            Object   obj;

            if (HttpContext.Current.Request.Cookies["DEPTOUT"] == null)
            {
                obj = "%";
            }
            else
            {
                obj = HttpContext.Current.Request.Cookies["DEPTOUT"].Value;
            }
            string strSqlCat = String.Format(@"SELECT CODE, NAME
                              FROM DOC_GOODSTYPE
                             WHERE ISDELETE = 'N'
                             AND EXISTS(SELECT 1 FROM SYS_DEPT WHERE TYPE IN ('3','4') AND CODE = '{1}')
                             AND CODE IN(SELECT DISTINCT A.CATID0 FROM DOC_GOODS A,DOC_GOODSCFG B,DOC_GOODSCFG C 
                                WHERE A.FLAG = 'Y' AND A.GDSEQ = B.GDSEQ AND A.GDSEQ = C.GDSEQ AND C.DEPTID LIKE NVL('{0}','%') AND B.DEPTID = '{1}')  ORDER BY CODE", obj.ToString(), UserAction.UserDept);

            repeaterCat.DataSource = DbHelperOra.Query(strSqlCat).Tables[0];
            repeaterCat.DataBind();
        }
Beispiel #53
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     string[] allKeys = base.Request.Params.AllKeys;
     if (allKeys.Contains("id") && base.Request["id"].ToString().bInt(ref this.id))
     {
         this.vote = VoteHelper.GetVote((long)this.id);
         if (this.vote == null)
         {
             this.ShowMsg("没有这个投票调查!", false);
         }
         this.hidpic.Value   = this.vote.ImageUrl;
         this.fkContent.Text = this.vote.Description;
         this.calendarStartDate.SelectedDate = new System.DateTime?(this.vote.StartDate.Date);
         this.calendarEndDate.SelectedDate   = new System.DateTime?(this.vote.EndDate.Date);
         System.Web.UI.WebControls.HiddenField hiddenField  = this.SetMemberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField2 = this.SetMemberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
         System.Web.UI.WebControls.HiddenField hiddenField3 = this.SetMemberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
         this.SetMemberRange.Grade        = this.vote.MemberGrades;
         this.SetMemberRange.DefualtGroup = this.vote.DefualtGroup;
         this.SetMemberRange.CustomGroup  = this.vote.CustomGroup;
         hiddenField.Value  = this.vote.MemberGrades;
         hiddenField2.Value = this.vote.DefualtGroup;
         hiddenField3.Value = this.vote.CustomGroup;
         if (this.vote.VoteItems != null && this.vote.VoteItems.Count > 0)
         {
             foreach (VoteItemInfo current in this.vote.VoteItems)
             {
                 this.items = this.items + current.VoteItemName + ",";
             }
         }
         this.items = this.items.TrimEnd(new char[]
         {
             ','
         }).Replace(',', '\n');
     }
 }
Beispiel #54
0
        private bool completarCampos(string estudioExtraID)
        {
            estudioExtraID = Convert.ToInt32(estudioExtraID).ToString();
            string        sql     = "SELECT institucion, titulo, tipoEstudioID, egreso FROM " + this.tabla + "estudioExtra WHERE estudioExtraID = '" + estudioExtraID + "';";
            SqlConnection adoConn = new SqlConnection(ConfigurationManager.ConnectionStrings["BaseSqlServer"].ConnectionString);

            adoConn.Open();
            SqlCommand adoCmd = new SqlCommand(sql, adoConn);

            base.Trace.Write(sql);
            SqlDataReader dr = adoCmd.ExecuteReader();

            if (dr.Read())
            {
                this.tipoEstudioID.DataBind();
                this.estudioExtraID.Value        = estudioExtraID;
                this.institucion.Text            = dr["institucion"].ToString();
                this.titulo.Text                 = dr["titulo"].ToString();
                this.tipoEstudioID.SelectedIndex = this.tipoEstudioID.Items.IndexOf(this.tipoEstudioID.Items.FindByValue(dr["tipoEstudioID"].ToString()));
                this.egreso.SelectedIndex        = this.egreso.Items.IndexOf(this.egreso.Items.FindByValue(dr["egreso"].ToString()));
                return(true);
            }
            return(false);
        }
Beispiel #55
0
        /// <summary>
        /// 提交到订货列表按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnBuy_Click(object sender, System.EventArgs e)
        {
            this.btnBuy.Enabled = false;                                    //禁用当前按钮
            ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); //当前登录用户信息

            if (currentManager != null /*&& currentManager.ClientUserId > 0*/)
            {
                string strSkuIds     = string.Empty; //存储所有订购商品的SkuId,用于操作后清除待选列表Erp_AgentProduct表数据
                int    shipaddressId = 0;            //送货地址Id
                int    givemodeId    = 0;            //配送方式Id
                int    paymodeId     = 0;            //支付方式Id

                ShoppingCartInfo shoppingCart = null;

                OrderInfo  orderInfo     = new OrderInfo();
                MemberInfo currentMember = MemberHelper.GetMember(currentManager.ClientUserId);
                foreach (System.Web.UI.WebControls.GridViewRow row in this.grdProducts.Rows)
                {
                    //decimal total = 0;
                    decimal price     = 0;                                                                                                 //单价
                    int     resultNum = 0;                                                                                                 //数量

                    System.Web.UI.WebControls.HiddenField txtboxvalue = (System.Web.UI.WebControls.HiddenField)row.FindControl("hiValue"); //得到SkuId
                    //System.Web.UI.WebControls.HiddenField txtboxproduct = (System.Web.UI.WebControls.HiddenField)row.FindControl("hiProductId");//得到ProductId
                    System.Web.UI.WebControls.Literal litSalePrice = (System.Web.UI.WebControls.Literal)row.FindControl("litSalePrice");

                    if (int.TryParse(txtboxvalue.Value.Trim(), out resultNum) && decimal.TryParse(litSalePrice.Text, out price))
                    {
                        string skuId = this.grdProducts.DataKeys[row.RowIndex].Value.ToString();
                        strSkuIds += "'" + skuId + "',";//累加SkuId值并用'',''分割
                        if (!string.IsNullOrEmpty(skuId))
                        {
                            //首先将商品插入购物车
                            //后台订单的购物车处理
                            int pcUserid = 0;
                            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.RegionalFunction && ManagerHelper.GetCurrentManager() != null)
                            {
                                int categoryId = CategoryBrowser.GetCategoryIdBySkuId(skuId);
                                pcUserid = currentManager.UserId;
                                ShoppingCartProcessor.AddLineItemPC(skuId, resultNum, categoryId, pcUserid);
                            }


                            //total += price * resultNum;//计算合计
                            //生成订单项

                            //shoppingCart = ShoppingCartProcessor.GetGroupBuyShoppingCart(currentMember, price, skuId, resultNum);
                            shoppingCart = ShoppingCartProcessor.GetShoppingCart(currentManager.UserId);
                            if (shoppingCart != null && shoppingCart.LineItems != null && shoppingCart.LineItems.Count > 0)
                            {
                                foreach (ShoppingCartItemInfo info2 in shoppingCart.LineItems)
                                {
                                    LineItemInfo info3 = new LineItemInfo
                                    {
                                        SkuId             = info2.SkuId,
                                        ProductId         = info2.ProductId,
                                        SKU               = info2.SKU,
                                        Quantity          = info2.Quantity,
                                        ShipmentQuantity  = info2.ShippQuantity,
                                        ItemCostPrice     = new SkuDao().GetSkuItem(info2.SkuId).CostPrice,
                                        ItemListPrice     = info2.MemberPrice,
                                        ItemAdjustedPrice = info2.AdjustedPrice,
                                        ItemDescription   = info2.Name,
                                        ThumbnailsUrl     = info2.ThumbnailUrl40,
                                        ItemWeight        = info2.Weight,
                                        SKUContent        = info2.SkuContent,
                                        PromotionId       = info2.PromotionId,
                                        PromotionName     = info2.PromotionName,
                                        MainCategoryPath  = info2.MainCategoryPath
                                    };
                                    orderInfo.LineItems.Add(info3.SkuId, info3);
                                }
                            }
                            else
                            {
                                this.ShowMsg("订单生成失败。", true);
                                this.btnBuy.Enabled = true;//启用当前按钮
                                return;
                            }
                        }
                    }
                }
                //一个商品数量都没输入,则退出
                if (string.IsNullOrEmpty(strSkuIds))
                {
                    this.ShowMsg("请输入商品数量。", true);
                    this.btnBuy.Enabled = true;//启用当前按钮
                    return;
                }

                //送货地址
                if (int.TryParse(this.userAddress.SelectedValue, out shipaddressId))
                {
                    ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(shipaddressId, Convert.ToInt32("99999" + currentManager.UserId.ToString()));//(shipaddressId, currentMember.UserId);
                    if (shippingAddress != null)
                    {
                        //this.userAddress.SelectedItem.Text
                        orderInfo.ShippingRegion = RegionHelper.GetFullRegion(shippingAddress.RegionId, ",");
                        orderInfo.RegionId       = shippingAddress.RegionId;
                        orderInfo.Address        = shippingAddress.Address;
                        orderInfo.ZipCode        = shippingAddress.Zipcode;
                        orderInfo.ShipTo         = shippingAddress.ShipTo;
                        orderInfo.TelPhone       = shippingAddress.TelPhone;
                        orderInfo.CellPhone      = shippingAddress.CellPhone;
                        MemberProcessor.SetDefaultShippingAddress(shipaddressId, Convert.ToInt32("99999" + currentManager.UserId.ToString()));
                    }
                }
                //配送方式
                if (int.TryParse(this.userGiveMode.SelectedValue, out givemodeId))
                {
                    ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(givemodeId, true);
                    if (shippingMode != null)
                    {
                        orderInfo.ShippingModeId = shippingMode.ModeId;
                        orderInfo.ModeName       = shippingMode.Name;
                        if (shoppingCart.LineItems.Count != shoppingCart.LineItems.Count((ShoppingCartItemInfo a) => a.IsfreeShipping))
                        {
                            orderInfo.AdjustedFreight = (orderInfo.Freight = ShoppingProcessor.CalcFreight(orderInfo.RegionId, shoppingCart.Weight, shippingMode));
                        }
                        else
                        {
                            orderInfo.AdjustedFreight = (orderInfo.Freight = 0m);
                        }
                    }
                }
                //支付方式
                if (int.TryParse(this.userPayMode.SelectedValue, out paymodeId))
                {
                    orderInfo.PaymentTypeId = paymodeId;
                    switch (paymodeId)
                    {
                    //case -1:
                    //case 0:
                    //    {
                    //        orderInfo.PaymentType = "货到付款";
                    //        orderInfo.Gateway = "hishop.plugins.payment.podrequest";
                    //        break;
                    //    }
                    //case 88:
                    //    {
                    //        orderInfo.PaymentType = "微信支付";
                    //        orderInfo.Gateway = "hishop.plugins.payment.weixinrequest";
                    //        break;
                    //    }
                    case 99:
                    {
                        orderInfo.PaymentType = "线下付款";
                        orderInfo.Gateway     = "hishop.plugins.payment.offlinerequest";
                        break;
                    }

                    default:
                    {
                        PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(paymodeId);
                        if (paymentMode != null)
                        {
                            orderInfo.PaymentTypeId = paymentMode.ModeId;
                            orderInfo.PaymentType   = paymentMode.Name;
                            orderInfo.Gateway       = paymentMode.Gateway;
                        }
                        break;
                    }
                    }
                }
                orderInfo.OrderId   = this.GenerateOrderId(currentManager.UserId); //生成ID
                orderInfo.OrderDate = System.DateTime.Now;                         //当前时间
                //基本信息
                orderInfo.OrderStatus    = OrderStatus.WaitBuyerPay;
                orderInfo.RefundStatus   = RefundStatus.None;
                orderInfo.ShipToDate     = "时间不限";
                orderInfo.ReferralUserId = 0;//订单的所属分销ID,没有就设置为0

                //代理商用户相关信息
                orderInfo.UserId       = Convert.ToInt32("99999" + currentManager.UserId.ToString()); //currentMember.UserId;
                orderInfo.Username     = currentManager.UserName;                                     //currentMember.UserName;
                orderInfo.EmailAddress = currentManager.Email;                                        //currentMember.Email;

                //orderInfo.RealName = currentMember.RealName;
                orderInfo.RealName = currentManager.AgentName;//存储用户后台昵称

                //orderInfo.QQ = currentMember.QQ;
                orderInfo.Remark      = this.txtOrderRemark.Text; //得到前端TextBox值
                orderInfo.OrderSource = 1;                        //来源代理商采购
                this.SetOrderItemStatus(orderInfo);



                if (ShoppingProcessor.CreatOrder(orderInfo))
                {
                    ShoppingCartProcessor.ClearShoppingCartPC();
                    //订单生成成功后清空
                    strSkuIds = strSkuIds.TrimEnd(',');
                    //清除已经订购的商品在订购列表中
                    ProductBrowser.DeleteAgentProduct(strSkuIds, currentManager.UserId);

                    this.ShowMsg("订单生成成功,请尽快完成支付。", true);
                }
                else
                {
                    this.ShowMsg("订单生成失败。", true);
                }

                //HiCache.Remove("DataCache-Categories");//刷前台缓存
                this.BindProducts();
            }
            else
            {
                this.ShowMsg("当前登录用户不是前端用户升级而来,无法进行生成订单操作。", true);
            }
            this.btnBuy.Enabled = true;//启用当前按钮
        }
    private string ReportingToCommonName(string removeEmpId, string empId, string hdCommonReportingToNameDB, string hdFunctionalToNameDB)
    {
        string strReturnVal = "";

        //if (removeEmpId.Trim() != hdCommonReportingToNameDB.Trim())
        //{
        //OLD Reporting ID
        List <string> allReportingTo             = hdCommonReportingToNameDB.Split(',').ToList();
        List <string> lstChkDifferentFunctionalM = new List <string> {
        };
        List <string> lstFinalFunctionalM        = new List <string> {
        };

        //REMOVE the resigned manager Id
        allReportingTo.Remove(removeEmpId);

        foreach (GridViewRow gvRow in grdvListofReportingEmployees.Rows)
        {
            System.Web.UI.WebControls.HiddenField hdEmpNo            = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfEmpId");
            System.Web.UI.WebControls.HiddenField hdReportingToName  = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfReportingToName");
            System.Web.UI.WebControls.HiddenField hdProjectId        = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfProjectId");
            System.Web.UI.WebControls.CheckBox    chkSel             = (System.Web.UI.WebControls.CheckBox)gvRow.FindControl("chkSelect");
            System.Web.UI.WebControls.HiddenField HdFunctionalToName = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfFunctionalToName");

            if (string.Equals(hdEmpNo.Value.Trim(), empId.Trim()) && chkSel.Checked)
            {
                //new functional manager list created
                lstChkDifferentFunctionalM.Add(HdFunctionalToName.Value);

                if (hdProjectId.Value != "0")
                {
                    if (string.Equals(hdEmpNo.Value.Trim(), empId.Trim()))
                    {
                        allReportingTo.Add(hdReportingToName.Value);
                    }
                }
                else
                {
                    List <string> newReportingTo = hdReportingToName.Value.Split(',').ToList();
                    //Siddhesh Arekar : Reporting Manager not updating : 17/06/2015 : Starts
                    if (hdCommonReportingToNameDB == hdFunctionalToNameDB)
                    {
                        //Siddhesh Arekar : Reporting Manager not updating : 17/06/2015 : End
                        newReportingTo.Remove(removeEmpId);
                    }

                    foreach (var itmR in newReportingTo)
                    {
                        allReportingTo.Add(itmR);
                    }
                }
            }
        }

        //select distinct reportingTo from list
        foreach (var itm in allReportingTo.Distinct())
        {
            if (strReturnVal == "")
            {
                strReturnVal = itm;
            }
            else
            {
                strReturnVal = strReturnVal + "," + itm;
            }
        }

        //if two different functional manager exists for the employee then return error message.
        lstFinalFunctionalM = lstChkDifferentFunctionalM.Distinct().ToList();
        if (lstFinalFunctionalM.Count > 1)
        {
            return("DuplicateFunctionalManager");
        }
        // }

        return(strReturnVal);
    }
        protected void SaveButtonClick(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = GenerateTable();


                foreach (GridViewRow rows in gvHydrate.Rows)
                {
                    System.Web.UI.WebControls.TextBox txtbox = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_hydrate_containerid");
                    string tbox = txtbox.Text;
                    if (tbox != "")
                    {
                        var row = dt.NewRow();
                        dt.Rows.Add(row);
                        System.Web.UI.WebControls.TextBox txtbox0 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_hydratedate");
                        string a = txtbox0.Text;
                        System.Web.UI.WebControls.HiddenField txtbox1 = (System.Web.UI.WebControls.HiddenField)rows.FindControl("txtbox_hydrate_id");
                        string a1 = txtbox1.Value;
                        System.Web.UI.WebControls.TextBox txtbox2 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_hydrate_containerid");
                        string a2 = txtbox2.Text;
                        System.Web.UI.WebControls.TextBox txtbox3 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_hydrate_ref");
                        string a3 = txtbox3.Text;
                        System.Web.UI.WebControls.TextBox txtbox4 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_hydrate_lsoda");
                        string a4 = txtbox4.Text;
                        row["SADATE"]      = a;
                        row["HYDRATE_ID"]  = a1;
                        row["CONTAINERID"] = a2;
                        row["REFLECTANCE"] = a3;
                        row["LEACHSODA"]   = a4;
                    }
                }
                if (dt.Rows != null)
                {
                    Update(dt);
                }

                dt.Clear();
                foreach (GridViewRow rows in gvWetHydrate.Rows)
                {
                    System.Web.UI.WebControls.TextBox txtbox = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydrate_containerid");
                    string tbox = txtbox.Text;
                    if (tbox != "")
                    {
                        var row = dt.NewRow();
                        dt.Rows.Add(row);
                        System.Web.UI.WebControls.TextBox txtbox0 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydratedate");
                        string a = txtbox0.Text;
                        System.Web.UI.WebControls.HiddenField txtbox1 = (System.Web.UI.WebControls.HiddenField)rows.FindControl("txtbox_wethydrate_id");
                        string a1 = txtbox1.Value;
                        System.Web.UI.WebControls.TextBox txtbox2 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydrate_containerid");
                        string a2 = txtbox2.Text;
                        System.Web.UI.WebControls.TextBox txtbox3 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydrate_ref");
                        string a3 = txtbox3.Text;
                        System.Web.UI.WebControls.TextBox txtbox4 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydrate_lsoda");
                        string a4 = txtbox4.Text;
                        System.Web.UI.WebControls.TextBox txtbox5 = (System.Web.UI.WebControls.TextBox)rows.FindControl("txtbox_wethydrate_moisture");
                        string a5 = txtbox5.Text;

                        row["SADATE"]      = a;
                        row["HYDRATE_ID"]  = a1;
                        row["CONTAINERID"] = a2;
                        row["REFLECTANCE"] = a3;
                        row["LEACHSODA"]   = a4;
                        row["MOISTURE"]    = a5;
                    }
                }
                if (dt.Rows != null)
                {
                    Update(dt);
                }



                loadData();

                this.Response.Redirect(this.Request.Url.ToString());
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #58
0
        private void btnSendMessage_Click(object sender, System.EventArgs e)
        {
            SiteSettings siteSetting = this.GetSiteSetting();
            string       sMSSender   = siteSetting.SMSSender;

            if (string.IsNullOrEmpty(sMSSender))
            {
                this.ShowMsg("请先选择发送方式", false);
                return;
            }
            ConfigData configData = null;

            if (siteSetting.SMSEnabled)
            {
                configData = new ConfigData(HiCryptographer.Decrypt(siteSetting.SMSSettings));
            }
            if (configData == null)
            {
                this.ShowMsg("请先选择发送方式并填写配置信息", false);
                return;
            }
            if (!configData.IsValid)
            {
                string text = "";
                foreach (string current in configData.ErrorMsgs)
                {
                    text += Formatter.FormatErrorMessage(current);
                }
                this.ShowMsg(text, false);
                return;
            }
            string text2 = this.txtmsgcontent.Value.Trim();

            if (string.IsNullOrEmpty(text2))
            {
                this.ShowMsg("请先填写发送的内容信息", false);
                return;
            }
            int    smsValidCount = this.GetSmsValidCount();
            string text3         = null;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdMemberList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    string text4 = ((System.Web.UI.DataBoundLiteralControl)gridViewRow.Controls[4].Controls[0]).Text.Trim().Replace("<div></div>", "").Replace("&nbsp;", "");
                    System.Web.UI.WebControls.HiddenField hiddenField = (System.Web.UI.WebControls.HiddenField)gridViewRow.FindControl("hidCellPhone");
                    text4 = hiddenField.Value;
                    if (!string.IsNullOrEmpty(text4) && System.Text.RegularExpressions.Regex.IsMatch(text4, "^(13|14|15|18)\\d{9}$"))
                    {
                        text3 = text3 + text4 + ",";
                    }
                }
            }
            if (text3 == null)
            {
                this.ShowMsg("请先选择要发送的会员或检测所选手机号格式是否正确", false);
                return;
            }
            text3 = text3.Substring(0, text3.Length - 1);
            string[] array;
            if (text3.Contains(","))
            {
                array = text3.Split(new char[]
                {
                    ','
                });
            }
            else
            {
                array = new string[]
                {
                    text3
                };
            }
            if (smsValidCount < array.Length)
            {
                this.ShowMsg("发送失败,您的剩余短信条数不足。可用条数:" + smsValidCount.ToString(), false);
                return;
            }
            SMSSender sMSSender2 = SMSSender.CreateInstance(sMSSender, configData.SettingsXml);
            string    msg;
            bool      success = sMSSender2.Send(array, text2, out msg);

            this.ShowMsg(msg, success);
            this.ValidSmsNum = this.GetSmsValidCount().ToString();
        }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            Rave.HR.BusinessLayer.Employee.Employee addEmployeeBAL = new Rave.HR.BusinessLayer.Employee.Employee();
            string chkUpdateEmpNo = "";

            if (Request.QueryString["page"] != null && Request.QueryString["page"] == "employeesummary")
            {
                empId = ddlEmployeeList.SelectedItem.Value;
            }
            else
            {
                employee = (BusinessEntities.Employee)Session[Common.SessionNames.EMPLOYEEDETAILS];
                empId    = employee.EMPId.ToString();
            }

            foreach (GridViewRow gvRow in grdvListofReportingEmployees.Rows)
            {
                System.Web.UI.WebControls.CheckBox    chkSel                  = (System.Web.UI.WebControls.CheckBox)gvRow.FindControl("chkSelect");
                System.Web.UI.WebControls.HiddenField hdEmpNo                 = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfEmpId");
                System.Web.UI.WebControls.HiddenField hdProjectId             = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfProjectId");
                System.Web.UI.WebControls.HiddenField hdReportingToName       = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfReportingToName");
                System.Web.UI.WebControls.HiddenField HdReportingToCommonName = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfReportingToCommonName");
                System.Web.UI.WebControls.HiddenField HdFunctionalToName      = (System.Web.UI.WebControls.HiddenField)gvRow.FindControl("HfFunctionalToName");

                if (chkSel != null && chkSel.Checked)
                {
                    if (hdProjectId.Value != "0")
                    {
                        //Update Project Allocation table T_ProjectAllocation
                        addEmployeeBAL.UpdateEmployeeFMRMForProjectAllocation(Convert.ToInt32(hdEmpNo.Value), hdReportingToName.Value, Convert.ToInt32(hdProjectId.Value));
                    }

                    if (!string.Equals(chkUpdateEmpNo.Trim(), hdEmpNo.Value.Trim()))
                    {
                        chkUpdateEmpNo = hdEmpNo.Value;
                        //Siddhesh Arekar : Reporting Manager not updating : 17/06/2015 : Starts
                        //Description - Added new parameter in ReportingToCommonName function for passing changed FunctionalToName
                        string HdReportingCommonNew = ReportingToCommonName(empId, hdEmpNo.Value, HdReportingToCommonName.Value, HdFunctionalToName.Value);
                        //Siddhesh Arekar : Reporting Manager not updating : 17/06/2015 : Ends

                        if (HdReportingCommonNew.Equals("DuplicateFunctionalManager"))
                        {
                            Page page = HttpContext.Current.Handler as Page;
                            ScriptManager.RegisterStartupScript(page, page.GetType(), "err_msg", "alert('Two different fucntional managers selected for same employee.');", true);
                            return;
                        }

                        //update common functional and reporting to T_Employees
                        if (HdReportingCommonNew != "")
                        {
                            addEmployeeBAL.UpdateEmployeeFMRM(Convert.ToInt32(hdEmpNo.Value), HdReportingCommonNew, Convert.ToInt32(HdFunctionalToName.Value));
                        }
                    }
                }
            }

            //Umesh: Issue 'Modal Popup issue in chrome' Starts
            ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "SaveMessage", "alert('Data Saved Successfully'); jQuery.modalDialog.getCurrent().close();", true);
            //Response.Write("<script type='text/javascript'>alert('Data Saved Successfully'); window.close();</script>");
            //Umesh: Issue 'Modal Popup issue in chrome' Ends
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, "ReportingOrFunctionalManager.aspx", "btnSave_Click", EventIDConstants.RAVE_HR_EMPLOYEE_BUSNIESS_LAYER);
        }
    }
Beispiel #60
0
        private void BindDate()
        {
            if (this._gameInfo != null)
            {
                this.memberCheck                      = (this._gameInfo.MemberCheck == 1);
                this.hfGameId.Value                   = this._gameInfo.GameId.ToString();
                this.txtGameTitle.Text                = this._gameInfo.GameTitle;
                this.dateBeginTime.SelectedDate       = new System.DateTime?(this._gameInfo.BeginTime);
                this.dateEndTime.SelectedDate         = new System.DateTime?(this._gameInfo.EndTime);
                this.txtDescription.Text              = this._gameInfo.Description.Replace("<br/>", "\n");
                this.txtNeedPoint.Text                = this._gameInfo.NeedPoint.ToString();
                this.txtGivePoint.Text                = this._gameInfo.GivePoint.ToString();
                this.cbOnlyGiveNotPrizeMember.Checked = this._gameInfo.OnlyGiveNotPrizeMember;
                this.txtLimitEveryDay.Text            = this._gameInfo.LimitEveryDay.ToString();
                this.txtMaximumDailyLimit.Text        = this._gameInfo.MaximumDailyLimit.ToString();
                System.Web.UI.WebControls.HiddenField hiddenField  = this.memberRange.FindControl("txt_Grades") as System.Web.UI.WebControls.HiddenField;
                System.Web.UI.WebControls.HiddenField hiddenField2 = this.memberRange.FindControl("txt_DefualtGroup") as System.Web.UI.WebControls.HiddenField;
                System.Web.UI.WebControls.HiddenField hiddenField3 = this.memberRange.FindControl("txt_CustomGroup") as System.Web.UI.WebControls.HiddenField;
                this.memberRange.Grade        = this._gameInfo.ApplyMembers;
                this.memberRange.CustomGroup  = this._gameInfo.CustomGroup;
                this.memberRange.DefualtGroup = this._gameInfo.DefualtGroup;
                hiddenField.Value             = this.memberRange.Grade;
                hiddenField2.Value            = this.memberRange.DefualtGroup;
                hiddenField3.Value            = this.memberRange.CustomGroup;
                switch (this._gameInfo.PlayType)
                {
                case PlayType.一天一次:
                case PlayType.一次:
                case PlayType.一天两次:
                case PlayType.两次:
IL_21C:
                    if (string.Equals(this._gameInfo.ApplyMembers, "0") && string.Equals(this._gameInfo.DefualtGroup, "0") && string.Equals(this._gameInfo.CustomGroup, "0"))
                    {
                        this.isAllCheck = true;
                    }
                    this.txtGameUrl.Text = this._gameInfo.GameUrl;
                    goto IL_2C6;
                }
                //goto IL_21C;
            }
            string text = System.Guid.NewGuid().ToString().Replace("-", "");

            this.hfKeyWord.Value = text;
            string text2 = this.CreateGameUrl(text);

            this.txtGameUrl.Text = text2;
IL_2C6:
            System.Collections.Generic.IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades();
            foreach (MemberGradeInfo current in memberGrades)
            {
                MemberGradeItem memberGradeItem = new MemberGradeItem();
                if (!this.isAllCheck)
                {
                    memberGradeItem.IsCheck = this.IsCheck(current.GradeId.ToString());
                }
                else
                {
                    memberGradeItem.IsCheck = this.isAllCheck;
                }
                memberGradeItem.Name    = current.Name;
                memberGradeItem.GradeId = current.GradeId.ToString();
                this._memberGrades.Add(memberGradeItem);
            }
        }