protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         lnkSaveAndAddnew.Visible = HasAdd;
         ViewState["SortOrder"]   = appFunctions.Enum_SortOrderBy.Asc;
         ViewState["SortColumn"]  = "";
         SetRegulerExpression();
         objCommon = new clsCommon();
         objCommon.BindEnumtoDDL(typeof(Enums.Enum_CouponCodeType), ddlType, "-- Select Type --");
         objCouponCode = null;
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
                 // noIdFoundRedirect("Employee.aspx");
             }
             objEncrypt = null;
             SetValuesToControls();
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "HideTab()", true);
         }
     }
 }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hdnProductDetailID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
            ViewState["SortOrder"]   = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"]  = "";
            //btnAdd.Visible = HasAdd;
            btnDelete.Visible = HasDelete;

            dgvGridView.Columns[0].Visible = HasDelete;
            // dgvGridView.Columns[1].Visible = HasEdit;
            objCommon = new clsCommon();
            objCommon.BindEnumtoDDL(typeof(Enums.Enum_ReviewStatus), ddlStatus, "--Select Status--");

            //   objCommon.FillDropDownList(ddlUserName, "tblRegistration", tblRegistration.ColumnNames.AppFullName, tblRegistration.ColumnNames.AppRegistrationID, "--Select UserName--", tblRegistration.ColumnNames.AppUserStatus + "<>" + Convert.ToInt32(Enums.Enum_UserStatus.Created));
            //  objCommon.FillDropDownList(ddlProfessionalName, "tblProfessional", tblProfessional.ColumnNames.AppProfessionalName, tblProfessional.ColumnNames.AppProfessionalID, "--Select Professional--", tblProfessional.ColumnNames.AppPublishedBy + "<>" + "0");
            objCommon = null;
            if (Session[appFunctions.Session.ShowMessage.ToString()] != null)
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }
            objCommon = new clsCommon();
            objCommon.FillRecordPerPage(ref ddlPerPage);
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    string pid = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                    //     ddlProfessionalName.SelectedValue = pid;
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }
            }
            LoadDataGrid(true, false);
            //txtSearch.Focus();
            objCommon = null;
        }
    }