示例#1
0
        public List <PasswordReset> checkSaltedPassword(int UserID, string strResetAnswer)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@UserID", UserID);
            dTable.Rows.Add("@ResetAnswer", strResetAnswer);
            //DataTable dt = objDAL.SelectWParameter(dTable, "sp_CheckSaltedPassword_GRH");
            DataTable dt = objDAL.SelectWParameter(dTable, "sp_CheckSaltedPassword_JKS");

            List <PasswordReset> lstSaltedPassword = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.iReturnValue = Convert.ToInt16(dt.Rows[i]["iReturnValue"]);

                lstSaltedPassword.Add(objPasswordReset);
            }
            return(lstSaltedPassword);
        }
示例#2
0
        public List <PasswordReset> ForgotChangePassword(int iUserID, string strNewPassword)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@UID", iUserID);
            dTable.Rows.Add("@NPassword", strNewPassword);
            //DataTable dt = objDAL.SelectWParameter(dTable, "sp_ForgotChangePassword_Encrypt_GRH");
            DataTable dt = objDAL.SelectWParameter(dTable, "sp_ForgotChangePassword_Encrypt_JKS");

            List <PasswordReset> lstForgotChangePassword = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.iReturnValue = Convert.ToInt16(dt.Rows[i]["iReturnValue"]);

                lstForgotChangePassword.Add(objPasswordReset);
            }
            return(lstForgotChangePassword);
        }
示例#3
0
        public List <PasswordReset> GetDuplicates(string InvoiceNo, string DocType, string BuyerCompanyID, string SupplierCompanyID)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@InvoiceNo", InvoiceNo);
            dTable.Rows.Add("@DocType", DocType);
            dTable.Rows.Add("@BuyerCompanyID", BuyerCompanyID);
            dTable.Rows.Add("@SupplierCompanyID", SupplierCompanyID);
            DataTable dt = objDAL.SelectWParameter(dTable, "chkDuplicateCNINV");

            List <PasswordReset> lstUserName = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.Duplicate = Convert.ToString(dt.Rows[i]["Duplicate"]);

                lstUserName.Add(objPasswordReset);
            }
            return(lstUserName);
        }
示例#4
0
        public List <PasswordReset> getSecurityQuestion(int UserID)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@UserID", UserID);
            //DataTable dt = objDAL.SelectWParameter(dTable, "sp_getSecurityQuestion");
            DataTable dt = objDAL.SelectWParameter(dTable, "sp_getSecurityQuestion_JKS");


            List <PasswordReset> lstPasswordReset = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.CompanyID     = Convert.ToString(dt.Rows[i]["CompanyID"]);
                objPasswordReset.ResetAnswer   = Convert.ToString(dt.Rows[i]["ResetAnswer"]);
                objPasswordReset.ResetLockout  = Convert.ToString(dt.Rows[i]["ResetLockout"]);
                objPasswordReset.ResetQuestion = Convert.ToString(dt.Rows[i]["ResetQuestion"]);

                lstPasswordReset.Add(objPasswordReset);
            }
            return(lstPasswordReset);
        }
示例#5
0
        public List <PasswordReset> GetApprovals(int UserID)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@UserID", UserID);
            DataTable dt = objDAL.SelectWParameter(dTable, "AwitingApprovals");

            List <PasswordReset> lstUserName = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.AwitingApprovalCompany = Convert.ToString(dt.Rows[i]["CompanyName"]);
                objPasswordReset.AwitingApproval        = Convert.ToString(dt.Rows[i]["AwitingApproval"]);
                lstUserName.Add(objPasswordReset);
            }
            return(lstUserName);
        }
示例#6
0
        public List <PasswordReset> GetUserNameByUserID(int UserID)
        {
            DataTable dTable = new DataTable();
            // create columns for the DataTable
            DataColumn ParameterName = new DataColumn("ParameterName", typeof(string));

            dTable.Columns.Add(ParameterName);
            // create one more column
            DataColumn ParameterValue = new DataColumn("ParameterValue", typeof(string));

            dTable.Columns.Add(ParameterValue);
            dTable.Rows.Add("@UserID", UserID);
            // DataTable dt = objDAL.SelectWParameter(dTable, "sp_GetEmailByUserID_GRH");
            DataTable dt = objDAL.SelectWParameter(dTable, "sp_GetEmailByUserID_JKS");

            List <PasswordReset> lstUserName = new List <PasswordReset>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PasswordReset objPasswordReset = new PasswordReset();
                objPasswordReset.UserName = Convert.ToString(dt.Rows[i]["UserName"]);


                lstUserName.Add(objPasswordReset);
            }
            return(lstUserName);
        }
示例#7
0
        /*--------------Added by kuntalkarar on 27thMay2016-------------------*/
        private void GetCompanyListForPurchaseInvoiceLog(int iCompanyID, int iAction)
        {
            if (iAction == 1)
            {
                Company objCompany = new Company();
                ddlCompany.Items.Clear();
                DataTable dt = new DataTable();
                //try
                //{

                //if (dt.Rows.Count > 0)
                //{
                //    ddlCompany.DataSource = dt;
                //    ddlCompany.DataBind();

                //    //--------------- Set Default Selected value  "Select Company Name"  by Subha,04-02-2015
                if (Convert.ToInt32(Session["UserTypeID"]) == 3)
                {
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    //ddlCompany.Items.Insert(0, "Select Company Name");
                    ddlCompany.Items.Insert(0, new ListItem("Select Company Name", "0"));

                    ddlCompany.SelectedValue = Session["CompanyID"].ToString();
                }

                //modified by kuntal on 29thApril2015
                else if (Convert.ToInt32(Session["UserTypeID"]) == 1)
                {
                    string LogInCompanyid = "";
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    //ddlCompany.Items.Insert(0, "Select Company Name");
                    ddlCompany.Items.Insert(0, new ListItem("Select Company Name", "0"));
                    PasswordReset        objPasswordReset  = new PasswordReset();
                    List <PasswordReset> lstSaltedPassword = objPasswordReset.GetLogInCompanyId(Convert.ToInt32(Session["UserID"]));//strResetAnswer
                    if (lstSaltedPassword.Count > 0)
                    {
                        LogInCompanyid = lstSaltedPassword[0].LoginCompanyId;
                    }


                    ddlCompany.SelectedValue = LogInCompanyid;
                }
                //else if (Convert.ToInt32(Session["UserTypeID"]) == 1)
                //{
                //    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                //    ddlCompany.DataSource = dt;
                //    ddlCompany.DataBind();
                //    ddlCompany.Items.Insert(0, "Select Company Name");

                //}
                //------------------------------------------------------------
                else
                {
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    //ddlCompany.Items.Insert(0, "Select Company Name");
                    ddlCompany.Items.Insert(0, new ListItem("Select Company Name", "0"));

                    ddlCompany.SelectedValue     = dt.Rows[0][0].ToString();
                    Session["DropDownCompanyID"] = ddlCompany.SelectedValue.ToString();
                }
                //}
            }
            //catch { }
            //finally
            //{
            //    ddlCompany.Items.Insert(0, new ListItem("Select Company Name", "0"));

            //}
            //}
        }
示例#8
0
        /*--------------Added by kuntalkarar on 27thMay2016-------------------*/
        private void GetCompanyListForPurchaseInvoiceLog(int iCompanyID, int iAction)
        {
            if (iAction == 1)
            {
                Company objCompany = new Company();
                ddlCompany.Items.Clear();
                DataTable dt = new DataTable();
                //try
                //{

                //if (dt.Rows.Count > 0)
                //{
                //    ddlCompany.DataSource = dt;
                //    ddlCompany.DataBind();

                //    //--------------- Set Default Selected value  "Select Company Name"  by Subha,04-02-2015
                if (Convert.ToInt32(Session["UserTypeID"]) == 3)
                {
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    ddlCompany.Items.Insert(0, "Select Company Name");

                    ddlCompany.SelectedValue = Session["CompanyID"].ToString();
                }

                //modified by kuntal on 29thApril2015
                else if (Convert.ToInt32(Session["UserTypeID"]) == 1)
                {
                    string LogInCompanyid = "";
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    ddlCompany.Items.Insert(0, "Select Company Name");
                    PasswordReset        objPasswordReset  = new PasswordReset();
                    List <PasswordReset> lstSaltedPassword = objPasswordReset.GetLogInCompanyId(Convert.ToInt32(Session["UserID"]));//strResetAnswer
                    if (lstSaltedPassword.Count > 0)
                    {
                        LogInCompanyid = lstSaltedPassword[0].LoginCompanyId;
                    }


                    ddlCompany.SelectedValue = LogInCompanyid;
                }
                //else if (Convert.ToInt32(Session["UserTypeID"]) == 1)
                //{
                //    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                //    ddlCompany.DataSource = dt;
                //    ddlCompany.DataBind();
                //    ddlCompany.Items.Insert(0, "Select Company Name");

                //}
                //------------------------------------------------------------
                else
                {
                    dt = objCompany.GetCompanyListForPurchaseInvoiceLog(Convert.ToInt32(Session["CompanyID"]), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
                    ddlCompany.DataSource = dt;
                    ddlCompany.DataBind();
                    ddlCompany.Items.Insert(0, "Select Company Name");

                    ddlCompany.SelectedValue     = dt.Rows[0][0].ToString();
                    Session["DropDownCompanyID"] = ddlCompany.SelectedValue.ToString();
                }
                //}
            }
            //catch { }
            //finally
            //{
            //    ddlCompany.Items.Insert(0, new ListItem("Select Company Name", "0"));

            //}
            //}

            //blocked for this page as this function was used in Current folder, so no use of supplie list population

            /*JKS.Invoice objInvoice = new JKS.Invoice();
             * ddlSupplier.Items.Clear();
             * if (ddlCompany.SelectedItem.Text != "Select Company Name")
             * {
             *  ddlSupplier.DataSource = objInvoice.GetSuppliersList(Convert.ToInt32(ddlCompany.SelectedValue.Trim()), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(Session["UserTypeID"]));
             * }
             * ddlSupplier.DataBind();
             * ddlSupplier.Items.Insert(0, new ListItem("Select Supplier", "0"));
             *
             * JKS.Invoice_New objInv1 = new JKS.Invoice_New();*/

            // GetVendorClassAgainstSupplierANDBuyer();//Added extra in this function for VendorClass
        }