Ejemplo n.º 1
0
    private void ReloadList(SPTypeDAL oSPTypeDAL, string sSPTpyeID)
    {
        Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

        spTypeList = new SPTypeList();
        Result oRslSPTypeList = oSPTypeDAL.LoadList(oConfig.UserName);

        spTypeList = (SPTypeList)oRslSPTypeList.Return;
        Session[Constants.SES_SPTYPELIST] = spTypeList;
        LoadSPDataList(spTypeList);
        LoadDenomDataListBySPTypeID(sSPTpyeID, spTypeList);
    }
Ejemplo n.º 2
0
    private void InitializeData()
    {
        Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

        gvList.PageSize = (int)Constants.PAGING_UNAPPROVED;

        if (Session[Constants.SES_SPTYPELIST] == null)
        {
            Session.Add(Constants.SES_SPTYPELIST, new SPTypeList());
        }
        else
        {
            Session[Constants.SES_SPTYPELIST] = new SPTypeList();
        }

        if (Session[Constants.SES_SPTYPE] == null)
        {
            Session.Add(Constants.SES_SPTYPE, new SPType());
        }
        else
        {
            Session[Constants.SES_SPTYPE] = new SPType();
        }


        SPTypeDAL spTypeDal = new SPTypeDAL();

        spTypeList = new SPTypeList();
        Result oRslSPTypeList = spTypeDal.LoadList(oConfig.UserName);

        spTypeList = (SPTypeList)oRslSPTypeList.Return;
        Session[Constants.SES_SPTYPELIST] = spTypeList;

        gvDenom.DataSource = null;
        gvDenom.DataBind();
        hdDataType.Value = "";

        // Dropdown load
        DDListUtil.LoadDDLFromDB(ddlCurrency, "CurrencyID", "CurrencyCode", "SPMS_Currency", true);

        string sPTypeID = Request.QueryString[OBJ_SPTYPE_ID];
        string sPageID  = Request.QueryString[OBJ_PAGE_ID];


        if (!string.IsNullOrEmpty(sPTypeID))
        {
            sPTypeID = oCrypManager.GetDecryptedString(sPTypeID, Constants.CRYPT_PASSWORD_STRING).Trim();
        }
        if (!string.IsNullOrEmpty(sPageID))
        {
            sPageID = oCrypManager.GetDecryptedString(sPageID, Constants.CRYPT_PASSWORD_STRING).Trim();
        }

        if (!string.IsNullOrEmpty(sPTypeID) && !string.IsNullOrEmpty(sPageID))
        {
            string sOperationType = sPageID.Substring(4, 1);
            if (Constants.OPERATION_TYPE_APPROVAL.Equals(sOperationType))
            {
                if (spTypeList.ListOfSPType.Count > 0)
                {
                    LoadDenomDataListBySPTypeID(sPTypeID.Trim(), spTypeList);
                    LoadSPDetailData(sPTypeID.Trim(), spTypeList);
                }

                // general Control
                Util.ControlEnabled(txtSpTypeId, false);
                Util.ControlEnabled(txtDescription, false);
                Util.ControlEnabled(ddlCurrency, false);
                Util.ControlEnabled(txtDenomination, false);
                Util.ControlEnabled(txtReOrderLevel, false);
                Util.ControlEnabled(txtSeries, false);
                Util.ControlEnabled(txtNoOfDigitInSeries, false);

                // user Detail
                Util.ControlEnabled(ucUserDet.FindControl("txtCheckerComments"), true);

                // button
                Util.ControlEnabled(btnReject, true);
                Util.ControlEnabled(btnApprove, true);
                Util.ControlEnabled(btnBack, true);

                Util.ControlEnabled(btnReset, false);
                Util.ControlEnabled(btnSave, false);
                Util.ControlEnabled(btnDelete, false);
                Util.ControlEnabled(btnLoad, false);

                Util.ControlEnabled(btnSaveDenom, false);
                Util.ControlEnabled(btnDenomReset, false);

                #region User-Detail.
                UserDetails oUserDetails = ucUserDet.UserDetail;
                oUserDetails.CheckerID = oConfig.UserName;
                oUserDetails.CheckDate = DateTime.Now;
                ucUserDet.UserDetail   = oUserDetails;
                #endregion User-Detail.

                fsList.Visible  = false;
                fsDenom.Visible = true;
            }
        }
        else
        {
            // button
            Util.ControlEnabled(btnReject, false);
            Util.ControlEnabled(btnApprove, false);
            Util.ControlEnabled(btnBack, false);

            Util.ControlEnabled(btnReset, true);
            Util.ControlEnabled(btnSave, true);
            Util.ControlEnabled(btnDelete, true);
            Util.ControlEnabled(btnLoad, true);

            Util.ControlEnabled(btnSaveDenom, true);
            Util.ControlEnabled(btnDenomReset, true);
            Util.ControlEnabled(ucUserDet.FindControl("txtCheckerComments"), false);
            #region User-Detail.
            UserDetails oUserDetails = new UserDetails();
            oUserDetails.MakerID  = oConfig.UserName;
            oUserDetails.MakeDate = DateTime.Now;
            ucUserDet.UserDetail  = oUserDetails;
            #endregion User-Detail.

            fsList.Visible  = true;
            fsDenom.Visible = true;
            LoadSPDataList(spTypeList);
        }
    }