예제 #1
0
        public string Validate(string oldPassword, string newPassword, string UserId, string PasswordKey)
        {
            try
            {
                // password = DbSecurity.Encrypt(oldPassword, ref passwordKey);
                //  UserId = CurrentUser.User.UserId.ToString();
                //  int count = objManager.IntMethodWithParam("Sp_UserCreation", "@QueryType", "@User", "@Password","@PasswordKey", "UpdatePassword", UserId, password, passwordKey);
                dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "@UserID", "CheckOldPassword", UserId);
                string Pass = (DbSecurity.Decrypt(dt.Rows[0]["Password"].ToString(), dt.Rows[0]["PasswordKey"].ToString()));
                if (Pass.Trim() == oldPassword.Trim())
                {
                    string NEWPassword = DbSecurity.Encrypt(newPassword, ref PasswordKey);
                    dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "@NewPassword", "@PasswordKey", "@UserID", "ChangePassword", NEWPassword, PasswordKey, UserId);

                    result = "1";
                }
                else
                {
                    result = "0";
                }

                return(result);
            }

            catch (Exception ex)
            {
                return("NotSccess");
            }
        }
예제 #2
0
        public DataTable CheckAdmin(string restroId, string accesscode, string UserId)
        {
            try
            {
                dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "@RestroId", "@UserId", "CheckManagerAccessCode", restroId, UserId);

                string Accesscode = "";

                foreach (DataRow row in dt.Rows)
                {
                    try
                    {
                        Accesscode = DbSecurity.Decrypt(row["AccessCode"].ToString(), row["AccessKey"].ToString());
                        //Accesscode = DbSecurity.Decrypt(row["AccessCode"].ToString(), row["AccessKey"].ToString());
                        if (Accesscode == accesscode)
                        {
                            dt.Columns.Add("result", typeof(string));
                            row["result"] = 1;
                        }

                        else
                        {
                            dt.Columns.Add("result", typeof(string));
                            row["result"] = -1;
                        }
                    }
                    catch { }
                }
            }
            catch { }
            return(dt);
        }
예제 #3
0
        public string LoginUser([FromBody] TblUserLogin user)


        {
            string getPass  = string.Empty;
            string getEmail = string.Empty;

            List <TblUserLogin> list = dbAccess.LoginUser(user);

            if (list.Count > 0)
            {
                foreach (var value in list)
                {
                    getPass  = DbSecurity.Decrypt(value.Password, value.PasswordKey);
                    getEmail = value.EmailId;
                }

                if (getPass == user.Password)
                {
                    HttpContext.Session.SetString("EmailId", user.EmailId);
                    string status = "success";
                    return(status);
                }
                else
                {
                    string status = "Wrong Password";
                    return(status);
                }
            }
            else
            {
                string status = "wrong emailid or password";
                return(status);
            }
        }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string UserId = DbSecurity.Decrypt(Request.QueryString["Id"]);
         ViewState["UserId"] = UserId;
     }
 }
예제 #5
0
        public string BindOrderDetails(string restroid, string OrderId)
        {
            string UserId  = CurrentUser.User.UserId.ToString();
            string orderId = DbSecurity.Decrypt(OrderId);


            DataSet result = PB.BindOrderDetails(restroid, orderId, UserId);

            return(JsonConvert.SerializeObject(result, Formatting.Indented));
        }
예제 #6
0
        public void Paymentprint(string restroid, string OrderId, string billno)
        {
            // Printing(); orderid, billno, restroid;
            string        UserId  = CurrentUser.User.UserId.ToString();
            string        orderId = DbSecurity.Decrypt(OrderId);
            PrintDocument pd      = new PrintDocument();

            temporderid  = orderId;
            tempbillno   = billno;
            temprestroid = restroid;


            pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
            // Print the document.
            pd.Print();
        }
예제 #7
0
        public int ChangePassword(string OldPassword, string NewPassword, string ConfmPassword, string UserId)
        {
            int       value             = -1;
            string    Password          = string.Empty;
            string    PasswordKey       = string.Empty;
            string    ChangePassword    = string.Empty;
            string    changePasswordKey = string.Empty;
            DataTable dt_results_Password;
            //CommonManger objManager = new CommonManger();
            var results_Password = context.MultipleResults("[dbo].[Sp_UserLogin]").With <UserDetails>().Execute("@QueryType", "@UserId", "FindPassword", UserId);

            foreach (var data in results_Password)
            {
                dataList_results_Password = data.Cast <UserDetails>().ToList();
            }
            dt_results_Password = ToDataTable(dataList_results_Password);
            //dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "@UserId", "FindPassword", UserId);
            if (dt_results_Password != null && dt_results_Password.Rows.Count > 0)
            {
                Password = DbSecurity.Decrypt(dt_results_Password.Rows[0]["Password"].ToString(), dt_results_Password.Rows[0]["PasswordKey"].ToString());
                if (Password == OldPassword)
                {
                    ChangePassword = DbSecurity.Encrypt(NewPassword, ref changePasswordKey);
                    //dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "@ChangePassword", "@ChangePasswordKey",
                    //    "@UserId", "UpdatePassword", ChangePassword, changePasswordKey, UserId);

                    var results = context1.MultipleResults("[dbo].[Sp_UserLogin]").With <DefaultPasswordChange>().Execute("@QueryType", "@ChangePassword", "@ChangePasswordKey",
                                                                                                                          "@UserId", "UpdatePassword", ChangePassword, changePasswordKey, UserId);
                    foreach (var data in results)
                    {
                        dataList_value = data.Cast <DefaultPasswordChange>().ToList();
                    }
                    dt_value = ToDataTable(dataList_value);

                    return(Convert.ToInt32(dt_value.Rows[0]["value"]));
                }
            }
            return(value);
        }
        // RejectMandate(fromdate, todate, IsMandateID, rejectcomnt);

        //public IEnumerable<DownloadMandateGridDetails> RejectMandate(string userID,string fromdate, string todate, string IsMandateID, string rejectcomnt)
        //{
        //    try
        //    {
        //        // var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With<DownloadMandateDetails>().Execute("@QueryType", "@UserId", "@strToDate", "@strFromDate", "@SponsorBankCode", todate fromdate   "grdMandateRefrenceWise",      userId, todate, fromdate, sponsorbankcode));
        //        var Result = dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With<DownloadMandateGridDetails>().Execute("@QueryType","@UserId", "@strToDate", "@strFromDate", "@strTable", "@RejectedReason", "RejectdataDateWise", userID, todate, fromdate, IsMandateID, rejectcomnt);

        //        foreach (var bgrid in Result)
        //        {
        //            dataListG = bgrid.Cast<DownloadMandateGridDetails>().ToList();

        //        }
        //        return dataListG;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public Dictionary <string, object> RejectMandate(string userID, string fromdate, string todate, string IsMandateID, string rejectcomnt)
        {
            //string mandateid = "<dtXml><dtXml MandateId='" + IsMandateID + "'/><dtXml>";
            //using (XmlWriter writer = XmlWriter.Create("books.xml"))
            //{
            //    writer.WriteStartElement("book");
            //    writer.WriteElementString("title", "Graphics Programming using GDI+");
            //    writer.WriteElementString("author", "Mahesh Chand");
            //    writer.WriteElementString("publisher", "Addison-Wesley");
            //    writer.WriteElementString("price", "64.95");
            //    writer.WriteEndElement();
            //    writer.Flush();
            //}
            string[] mandatearr = IsMandateID.Split(',');



            XDocument doc = new XDocument();

            doc.Add(new XElement("dtXml", mandatearr.Select(x => new XElement("MandateId", x))));


            DataTable dt = new DataTable();

            dt.Columns.Add("MandateId", typeof(Int64));
            // Boolean IsFound = false;

            for (int i = 0; i < mandatearr.Length; i++)
            {
                DataRow dr = dt.NewRow();

                // dr = IsMandateID;
                dt.Rows.Add(mandatearr[i]);

                // dt.Rows.Add(dr);
                //IsFound = true;
                // }
                //}
            }
            string strTable = GetXmlByDatable(dt);

            try
            {
                var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <DownloadMandateGridDetails>().Execute("@QueryType", "@UserId", "@strToDate", "@strFromDate", "@strTable", "@RejectedReason", "RejectdataDateWise", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(userID.Replace("_", "%"))), todate, fromdate, strTable, rejectcomnt));
                return(Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public IEnumerable <DownloadMandateDetails> Binddropdownbank(string userId)
        {
            // List<DownloadMandateDetails> dataList = new List<DownloadMandateDetails>();
            try
            {
                var Result = dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <DownloadMandateDetails>().Execute("@QueryType", "@UserId", "UserBank", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(userId.Replace("_", "%"))));

                foreach (var employe in Result)
                {
                    dataList = employe.Cast <DownloadMandateDetails>().ToList();
                }
                return(dataList);

                // return Result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #10
0
 public Dictionary <string, object> getUserReportData(string EntityId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_user]").With <UserReport>().Execute("@QueryType", "@EntityId", "ExportExcel_UserGrid", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #11
0
        public IEnumerable <Users> SaveUserData(Users userdata, string EntityId, string UserId, string dtUserRights_1, string dtUserRights_2, string dtSponsorBankCode, string dtCategoryCode, string dtPresentmentMaker, int chkPresentMaker, int chkPresentChecker, int IsZipSure, int IsAllowFundTransfer, int IsMandateEdit, int Ismandate, int IsBulk, int iSDashboard, int IsEnableCancel, int IsViewAll, string Defaultpwd, string dtPaymentMode, string dtUserRights_3, string dtUserRights_4, int chkRefEdit)
        {
            try
            {
                string password    = "";
                string passwordKey = "";

                if (Defaultpwd.Trim() != "")
                {
                    Defaultpwd = Convert.ToString(ConfigurationManager.AppSettings["DefaultPswdUser"]);
                    password   = DbSecurity.Encrypt(Defaultpwd, ref passwordKey);
                }


                var Result = dbcontext.MultipleResults("[dbo].[sp_user]").With <Users>().Execute("@QueryType", "@XmlSponsorBankCode", "@EntityId", "@Type"
                                                                                                 , "@UserId", "@ContactNo", "@EmailId", "@userNameId",
                                                                                                 "@password", "@passwordKey", "@XmlPaymentMode", "@IsBulkMandate", "@IsMandate", "@IsMandateEdit", "@IsRefrenceEdit",
                                                                                                 "@EmailSendTo", "@IsAllowFundTransfer", "@IsZipSure", "@APPId", "@PresentmentMaker", "@PresentmentChecker", "@XmlPresentmentMaker", "@XmlUserRightsA", "@XmlUserRightsB", "@XmlUserRightsC", "@XmlUserRightsD", "@NachViewUserID", "@IsDashBoard", "@IsEnableCancel", "@BankValidationUserCount", "@AcValidationUserCount", "@IsViewAll", "@XmlCategoryCode", "SaveData"
                                                                                                 , dtSponsorBankCode, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%"))), userdata.Type, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))), userdata.PhoneNo, userdata.EmailId, userdata.UserName,
                                                                                                 password, passwordKey, dtPaymentMode, IsBulk.ToString(), Ismandate.ToString(), IsMandateEdit.ToString(), chkRefEdit.ToString(), userdata.emailsent, IsAllowFundTransfer.ToString(), IsZipSure.ToString(), Convert.ToString(ConfigurationManager.AppSettings["APPId"]), chkPresentMaker.ToString(), chkPresentChecker.ToString(), dtPresentmentMaker, dtUserRights_1, dtUserRights_2, dtUserRights_3, dtUserRights_4, userdata.nachuser, iSDashboard.ToString(), IsEnableCancel.ToString(), Convert.ToString(userdata.bankval), Convert.ToString(userdata.accountval), IsViewAll.ToString(), dtCategoryCode);

                foreach (var usrdata in Result)
                {
                    //Flag = employe.Cast<ResFlag>().ToList() .Select(x=>x.Responseflag).First().ToString();
                    dataList = usrdata.Cast <Users>().ToList();
                }
                return(dataList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #12
0
        public Dictionary <string, object> BindGrid(string UserId)
        {
            try
            {
                var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <BindGrid>().Execute("@QueryType", "@UserId", "grdMandate", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%")))));
                return(Result);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #13
0
        public ActionResult BindOrderidtakeaway(string neworder)
        {
            string orderid = DbSecurity.Decrypt(neworder);

            return(Json(orderid, JsonRequestBehavior.AllowGet));
        }
예제 #14
0
 public Dictionary <string, object> UpdateAutoRejectReasonBankValidation(string mandateid, string UserId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <SaveData8>().Execute("@QueryType", "@MandateId", "@UserId", "UpdateAutoRejectReasonBankValidation", mandateid, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #15
0
        public Dictionary <string, object> CheckReference(CheckReference checkreference, string mandateId, string EntityId)
        {
            try
            {
                if (mandateId == "0")
                {
                    mandateId = "";
                }
                else
                {
                }

                var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <CheckReference>().With <CheckReference>().Execute("@QueryType", "@mandateId", "@Refrence1", "@EntityId", "CheckRefrence", mandateId, checkreference.Refrence1, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%")))));
                // Result.Add("IsRefrenceCheck", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(IsRefrenceCheck.Replace("_", "%"))));
                return(Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #16
0
        public ActionResult BindtempOrderiddinein(string order)
        {
            string tempid = DbSecurity.Decrypt(order);

            return(Json(tempid, JsonRequestBehavior.AllowGet));
        }
        public IEnumerable <DownloadMandateGridDetails> BindGridRef(string userId, string refNo)
        {
            try
            {
                // var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With<DownloadMandateDetails>().Execute("@QueryType", "@UserId", "@strToDate", "@strFromDate", "@SponsorBankCode", "grdMandateRefrenceWise", userId, todate, fromdate, sponsorbankcode));
                var Result = dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <DownloadMandateGridDetails>().Execute("@QueryType", "@UserId", "@Refrence1", "grdMandateRefrenceWise", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(userId.Replace("_", "%"))), refNo);

                foreach (var bgrid in Result)
                {
                    dataListG = bgrid.Cast <DownloadMandateGridDetails>().ToList();
                }
                return(dataListG);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #18
0
 public IEnumerable <HistoricalMandateClass> GetDataFromDB(string FromDate, string ToDate, string UserId)
 {
     try
     {
         var Result = dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <HistoricalMandateClass>().Execute("@QueryType", "@ToDate", "@FromDate", "@UserId", "grdMandateDataDateWise", ToDate, FromDate, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))));
         foreach (var HistoricalMandateData in Result)
         {
             dataList = HistoricalMandateData.Cast <HistoricalMandateClass>().ToList();
         }
         return(dataList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #19
0
        public ActionResult DecryptOrderID(string OrderId)
        {
            string orderId = DbSecurity.Decrypt(OrderId);

            return(Json(orderId, JsonRequestBehavior.AllowGet));
        }
예제 #20
0
파일: LoginDAL.cs 프로젝트: Mandavi10/RPOS
        public string Validate(string UserPin, string Password)
        {
            try
            {
                dt = objManager.FillDatatableWithParam("Sp_UserLogin", "@QueryType", "getAccessDate");
                if (dt != null && dt.Rows.Count > 0)
                {
                    Accessdate = DbSecurity.Decrypt(dt.Rows[0][0].ToString());
                }
            }
            catch { }

            string Username      = "";
            string matchedUserID = "";
            string Accessscode   = "";
            //string RoleId = dt.Rows[0][9].ToString();
            Boolean IsFoundAccessCode = false;
            var     result            = " ";

            if (Password != "")
            {
                DataSet ds = objManager.FillDatasetWithParam
                                 ("Sp_UserLogin", "@QueryType", "@AccessDate", "@UserPin", "CheckUserDetails", Accessdate, UserPin);
                dt = ds.Tables[0];

                foreach (DataRow row in dt.Rows)
                {
                    try
                    {
                        string pass = DbSecurity.Decrypt(row["Password"].ToString(), row["PasswordKey"].ToString());
                        if (pass == Password)
                        {
                            matchedUserID     = DbSecurity.Decrypt(row["AccessCode"].ToString(), row["AccessKey"].ToString());
                            Username          = Convert.ToString(row["UserName"]);
                            IsFoundAccessCode = true;
                            User.SaveUserToSession(ds);
                            break;
                        }
                        else
                        {
                            result = "1";
                            return(result);
                        }
                    }
                    catch { }
                }

                if (IsFoundAccessCode == true)
                {
                    int count = objManager.IntMethodWithParam("Sp_UserLogin", "@QueryType", "@UserId", "LogIn", CurrentUser.User.UserId.ToString());
                    try
                    {
                        result = "4";
                    }
                    catch { }
                }
                else
                {
                    if (Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd")) >= Convert.ToDateTime(Accessdate))
                    {
                        result = "2";
                        return(result);
                    }
                    else
                    {
                        result = "3";
                        return(result);
                    }
                }
            }
            else
            {
                result = "0";
                return(result);
            }
            return(result);
        }
예제 #21
0
        public IEnumerable <CommonFlag> UpdateForgot(string Password, string Email)
        {
            List <Forgotflag> dataList          = new List <Forgotflag>();
            string            ChangePassword    = string.Empty;
            string            changePasswordKey = string.Empty;

            try
            {
                if (Password.Length >= 6)
                {
                    ChangePassword = DbSecurity.Encrypt(Password, ref changePasswordKey);
                    var Result = dbcontext.MultipleResults("[dbo].[sp_UserLogin]").With <Forgotflag>().Execute("@QueryType", "@ChangePassword", "@ChangePasswordKey",
                                                                                                               "@UserId", "UpdatePassword", ChangePassword, changePasswordKey, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(Email.Replace("_", "%"))));
                    dataList = Result.FirstOrDefault().Cast <Forgotflag>().ToList();
                    if (dataList.Count > 0)
                    {
                        Flag.Flag      = "1";
                        Flag.FlagValue = "Password Updated Successfuly !!";
                        common.Add(Flag);
                    }
                    else
                    {
                        Flag.Flag      = "0";
                        Flag.FlagValue = "Invalid UserId !!";
                        common.Add(Flag);
                    }
                }
                else
                {
                    Flag.Flag      = "0";
                    Flag.FlagValue = "Minimum length of password is 6 !!";
                    common.Add(Flag);
                }

                return(common);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #22
0
        public IEnumerable <CommonFlag> Binddetails(string Username, string Password)
        {
            List <Logindetails> dataList = new List <Logindetails>();

            try
            {
                var Result = dbcontext.MultipleResults("[dbo].[sp_UserLogin]").With <Logindetails>().Execute("@QueryType", "@UserName", "GetUser", Username);
                foreach (var Logindata in Result)
                {
                    dataList = Logindata.Cast <Logindetails>().ToList();
                    if (dataList.Count > 0)
                    {
                        string strDbPassword = DbSecurity.Decrypt(Convert.ToString(Logindata.Cast <Logindetails>().ToList().Select(x => x.Password).First().ToString()), Convert.ToString(Logindata.Cast <Logindetails>().ToList().Select(x => x.PasswordKey).First().ToString()));
                        if (strDbPassword.Trim() != Password)
                        {
                            Flag.Flag      = "0";
                            Flag.FlagValue = "Wrong Username or Password!!";
                            common.Add(Flag);
                        }
                        else
                        {
                            Random generator = new Random();
                            QuickCheckEmandate_AngularEntities dbcontext = new QuickCheckEmandate_AngularEntities();
                            var SaveLoginSessionTrxn = dbcontext.MultipleResults("[dbo].[sp_UserLogin]").With <SaveLoginSessionTrxn>().Execute("@QueryType", "@UserId", "@TokenID", "@IPAddress", "@MacAddress", "@IsLogin", "SaveLoginSessionTrxn", Convert.ToString(Logindata.Cast <Logindetails>().ToList().Select(x => x.UserId).First().ToString()), Convert.ToString(generator.Next(1, 1000000)), Convert.ToString(GetIpAddress()), Convert.ToString(GetMacAddress()), Convert.ToString(1));
                            foreach (var Existlogin in SaveLoginSessionTrxn)
                            {
                                //  if (Existlogin.Cast<SaveLoginSessionTrxn>().ToList().Select(x => x.SessionActive).First().ToString() == "0")
                                //  {
                                #region Session creation
                                // Iace.User.User.SaveUserToSession(dataList);
                                Flag.IsRefrenceCheck    = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsRefrenceCheck).First().ToString()))).Replace("%", "_");
                                Flag.IsOverPrintMandate = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsOverPrintMandate).First().ToString()))).Replace("%", "_");
                                Flag.IsBulkMandate      = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsBulkMandate).First().ToString()))).Replace("%", "_");
                                Flag.IsMandate          = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsMandate).First().ToString()))).Replace("%", "_");
                                //NewCode
                                Flag.IsMandateEdit       = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsMandateEdit).First().ToString()))).Replace("%", "_");
                                Flag.IsRefrenceEdit      = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsRefrenceEdit).First().ToString()))).Replace("%", "_");
                                Flag.IsEmandate          = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsEmandate).First().ToString()))).Replace("%", "_");
                                Flag.IsPhysical          = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsPhysical).First().ToString()))).Replace("%", "_");
                                Flag.IsZipShoreABPS      = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsZipShoreABPS).First().ToString()))).Replace("%", "_");
                                Flag.UserId              = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.UserId).First().ToString()))).Replace("%", "_");
                                Flag.ReferenceId         = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(dataList.Cast <Logindetails>().ToList().Select(x => x.ReferenceId).First().ToString())).Replace("%", "_");
                                Flag.UserName            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.UserName).First().ToString()))).Replace("%", "_");
                                Flag.Password            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.Password).First().ToString()))).Replace("%", "_");
                                Flag.PasswordKey         = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.PasswordKey).First().ToString()))).Replace("%", "_");
                                Flag.UserCode            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.UserCode).First().ToString()))).Replace("%", "_");
                                Flag.UserType            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.UserType).First().ToString()))).Replace("%", "_");
                                Flag.BranchId            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(dataList.Cast <Logindetails>().ToList().Select(x => x.BranchId).First().ToString())).Replace("%", "_");
                                Flag.BranchName          = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.BranchName).First().ToString()))).Replace("%", "_");
                                Flag.IsDefaultPswdChange = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsDefaultPswdChange).First().ToString()))).Replace("%", "_");
                                Flag.LastLogin           = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.LastLogin).First().ToString()))).Replace("%", "_");
                                Flag.IsActive            = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsActive).First().ToString()))).Replace("%", "_");
                                Flag.IsDeleted           = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(Convert.ToString(dataList.Cast <Logindetails>().ToList().Select(x => x.IsDeleted).First().ToString()))).Replace("%", "_");
                                Flag.CreatedBy           = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(dataList.Cast <Logindetails>().ToList().Select(x => x.CreatedBy).First().ToString())).Replace("%", "_");
                                Flag.CreatedOn           = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(dataList.Cast <Logindetails>().ToList().Select(x => x.CreatedOn).First().ToString())).Replace("%", "_");
                                #endregion

                                Flag.Flag = "1";
                                common.Add(Flag);
                                //}
                                //else {
                                //    Flag.Flag = "0";
                                //    Flag.FlagValue = "User already logged on. Either Try logging in after closing the current session or Try after some time!!";
                                //    common.Add(Flag);
                                //}
                            }
                        }
                    }
                    else
                    {
                        Flag.Flag      = "0";
                        Flag.FlagValue = "Invalid User!!";
                        common.Add(Flag);
                    }
                }
                return(common);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #23
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                lblDispMessage.Text    = "";
                lblDispMessage.Visible = false;
                string strErrMessage = string.Empty;
                #region Check conditions
                if (txtUserName.Value == "" && txtpassword.Value == "")
                {
                    lblDispMessage.Text = "Please enter a user name and valid password";
                    lblDispMessage.Style.Add("color", "red");
                    lblDispMessage.Visible = true;
                    return;
                }
                else
                {
                    lblDispMessage.Text    = "";
                    lblDispMessage.Visible = false;
                }

                if (txtUserName.Value == "")
                {
                    lblDispMessage.Text = "Please enter a user name";
                    lblDispMessage.Style.Add("color", "red");
                    lblDispMessage.Visible = true;
                    return;
                }
                else
                {
                    lblDispMessage.Text    = "";
                    lblDispMessage.Visible = false;
                }


                if (txtpassword.Value == "")
                {
                    lblDispMessage.Text = "Please enter Password";
                    lblDispMessage.Style.Add("color", "red");
                    lblDispMessage.Visible = true;
                    return;
                }
                else
                {
                    lblDispMessage.Text    = "";
                    lblDispMessage.Visible = false;
                }

                #endregion
                if (txtpassword.Value != "" && txtUserName.Value != "")
                {
                    var results = context.MultipleResults("[dbo].[FAMS_Login]").With <Logindetails>()
                                  .Execute("@QueryType", "@Emailid", "UserAccess", txtUserName.Value);
                    foreach (List <Logindetails> cust in results)
                    {
                        if (cust.Count > 0)
                        {
                            if (cust.FirstOrDefault().EmailId == "0")
                            {
                                lblDispMessage.Text = "User is InActive!!";
                                lblDispMessage.Style.Add("color", "red");
                                lblDispMessage.Visible = true;
                            }
                            else if (cust.FirstOrDefault().EmailId == "-1")
                            {
                                lblDispMessage.Text = "Invalid User!!";
                                lblDispMessage.Style.Add("color", "red");
                                lblDispMessage.Visible = true;
                            }
                            else
                            {
                                string strDbPassword = DbSecurity.Decrypt(cust.FirstOrDefault().Password, cust.FirstOrDefault().PasswordKey);
                                if (strDbPassword != txtpassword.Value.Trim())
                                {
                                    lblDispMessage.Text = "Wrong  Password!!";
                                    lblDispMessage.Style.Add("color", "red");
                                    lblDispMessage.Visible = true;
                                }
                                else
                                {
                                    if (Convert.ToString(cust.FirstOrDefault().UserType) == "1")
                                    {
                                        Session["UserId"]      = Convert.ToString(cust.FirstOrDefault().UserId);
                                        Session["EmailId"]     = Convert.ToString(cust.FirstOrDefault().EmailId);
                                        Session["UserName"]    = Convert.ToString(cust.FirstOrDefault().UserName);
                                        Session["WareHouseId"] = Convert.ToString(cust.FirstOrDefault().WareHouseId);
                                        Session["AccountNo"]   = Convert.ToString(cust.FirstOrDefault().AccountNo);

                                        Session["IsDefaultPswdChange"] = Convert.ToString(cust.FirstOrDefault().IsDefaultPswdChange); // Added by Bibhu on 16May2020
                                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Only alert Message');", true);
                                        txtpassword.Value = "";
                                        txtUserName.Value = "";
                                        Response.Redirect("\\master\\reportsDashboard.aspx");
                                        ////Added by Bibhu on 15May2020 start
                                        //if (cust.FirstOrDefault().IsDefaultPswdChange == false)
                                        //{
                                        //    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "$('#changepasswordpop').modal('show');", true);
                                        //}
                                        ////Added by Bibhu on 15May2020 end
                                    }
                                    else if (Convert.ToString(cust.FirstOrDefault().UserType) == "2")
                                    {
                                        Session["UserId"]              = Convert.ToString(cust.FirstOrDefault().UserId);
                                        Session["EmailId"]             = Convert.ToString(cust.FirstOrDefault().EmailId);
                                        Session["UserName"]            = Convert.ToString(cust.FirstOrDefault().UserName);
                                        Session["WareHouseId"]         = Convert.ToString(cust.FirstOrDefault().WareHouseId);
                                        Session["AccountNo"]           = Convert.ToString(cust.FirstOrDefault().AccountNo);
                                        Session["IsDefaultPswdChange"] = Convert.ToString(cust.FirstOrDefault().IsDefaultPswdChange); // Added by Bibhu on 16May2020

                                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Only alert Message');", true);
                                        txtpassword.Value = "";
                                        txtUserName.Value = "";
                                        Response.Redirect("\\master\\reportsDashboard.aspx");
                                        ////Added by Bibhu on 15May2020 start
                                        //if (cust.FirstOrDefault().IsDefaultPswdChange == false)
                                        //{
                                        //    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "$('#changepasswordpop').modal('show');", true);
                                        //}
                                        ////Added by Bibhu on 15May2020 end
                                    }
                                    else if (Convert.ToString(cust.FirstOrDefault().UserType) == "3")
                                    {
                                        Session["UserId"]              = Convert.ToString(cust.FirstOrDefault().UserId);
                                        Session["EmailId"]             = Convert.ToString(cust.FirstOrDefault().EmailId);
                                        Session["UserName"]            = Convert.ToString(cust.FirstOrDefault().UserName);
                                        Session["WareHouseId"]         = Convert.ToString(cust.FirstOrDefault().WareHouseId);
                                        Session["AccountNo"]           = Convert.ToString(cust.FirstOrDefault().AccountNo);
                                        Session["IsDefaultPswdChange"] = Convert.ToString(cust.FirstOrDefault().IsDefaultPswdChange); // Added by Bibhu on 16May2020

                                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Only alert Message');", true);
                                        txtpassword.Value = "";
                                        txtUserName.Value = "";
                                        Response.Redirect("\\master\\Dashboard.aspx");
                                        ////Added by Bibhu on 15May2020 start
                                        //if (cust.FirstOrDefault().IsDefaultPswdChange == false)
                                        //{
                                        //    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "$('#changepasswordpop').modal('show');", true);
                                        //}
                                        ////Added by Bibhu on 15May2020 end
                                    }
                                    else
                                    {
                                    }
                                }
                            }
                        }
                        else
                        {
                            txtUserName.Value   = "";
                            lblDispMessage.Text = "Invalid User!!";
                            lblDispMessage.Style.Add("color", "red");
                            lblDispMessage.Visible = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #24
0
 public Dictionary <string, object> GetAllUsers(string EntityId, string PageCount, string Search_Text)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_user]").With <UserData>().With <UtilityCodes>().With <SponsorBankCode>().With <EntityPaymentMode>().With <UserEntity>().With <EntityMandateMode>().With <TempData>().With <CategoryCodes>().Execute("@QueryType", "@EntityId", "@PageCount", "@Search_Text", "BindUser", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%"))), PageCount, Search_Text));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #25
0
 public Dictionary <string, object> GetPageLoaddata(string UserId, string EntityId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <BindEntityDetails> ().With <BindLogoImageDetails>().With <BindBankNameDetails>().With <BindSponserCode>().With <BindBankUtilityCode>().With <BindBankPaymentMode>().With <BindEntityDetailsdata>().With <BindDebitType>().With <Bindfrequency>().With <BindEntityPeriods>().With <BindEntitydebitcredit>().With <BindEntityCategorytype>().With <BindLogincheck>().Execute("@QueryType", "@UserId", "@EntityId", "UserData", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))), DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #26
0
 public Dictionary <string, object> GetAllMakers(string EntityId, string UserId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_user]").With <Maker>().With <NachUser>().Execute("@QueryType", "@EntityId", "@UserId", "BindPresentmentMaker", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%"))), DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #27
0
        public Dictionary <string, object> SaveData(SaveData savedata, string UserId, string EntityId, string mandateid)
        {
            var Result = new Dictionary <string, object>();

            try
            {
                if (mandateid == "0")
                {
                    Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <SaveData0>().With <SaveData1>().With <SaveData2>().With <SaveData3>().With <SaveData4>().With <SaveData5>().With <SaveData6>().With <SaveData7>().With <SaveData8>().Execute("@QueryType", "@SponsorCode", "@UtilityCode", "@DebitType", "@Frequency", "@UserId", "@EntityId",
                                                                                                                                                                                                                                                                               "@ToDebit", "@AcNo", "@BankName", "@IFSC", "@MICR", "@AmountRupees", "@Refrence1", "@Refrence2", "@PhNumber",
                                                                                                                                                                                                                                                                               "@EmailId", "@From", "@To", "@Customer1", "@Customer2", "@Customer3", "@DateOnMandate", "@MandateMode", "@AmountWords", "@CategoryCode", "SaveData", savedata.Sponsorcode, savedata.Utilitycode, savedata.Debittype, savedata.Frequency, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))), DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%"))),
                                                                                                                                                                                                                                                                               savedata.Todebit, savedata.Bankaccountno, savedata.Withbank,
                                                                                                                                                                                                                                                                               savedata.IFSC.ToUpper(), savedata.MICR.ToUpper(), savedata.Amountrupees, savedata.Refrence1, savedata.Refrence2, savedata.Phoneno, savedata.Email, savedata.PeriodFrom, savedata.PeriodTo, savedata.Customer1,
                                                                                                                                                                                                                                                                               savedata.Customer2, savedata.Customer3, savedata.UMRNDATE, savedata.MandateMode, savedata.Amount, savedata.Catagorycode));
                }
                else
                {
                    Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <SaveData0>().With <SaveData1>().With <SaveData2>().With <SaveData3>().With <SaveData4>().With <SaveData5>().With <SaveData6>().With <SaveData7>().With <SaveData8>().Execute("@QueryType", "@SponsorCode", "@UtilityCode", "@DebitType", "@Frequency", "@UserId", "@EntityId",
                                                                                                                                                                                                                                                                               "@ToDebit", "@AcNo", "@BankName", "@IFSC", "@MICR", "@AmountRupees", "@Refrence1", "@Refrence2", "@PhNumber",
                                                                                                                                                                                                                                                                               "@EmailId", "@From", "@To", "@Customer1", "@Customer2", "@Customer3", "@DateOnMandate", "@MandateMode", "@AmountWords", "@CategoryCode", "@MandateId", "UpdateData", savedata.Sponsorcode, savedata.Utilitycode, savedata.Debittype, savedata.Frequency, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))), DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%"))),
                                                                                                                                                                                                                                                                               savedata.Todebit, savedata.Bankaccountno, savedata.Withbank,
                                                                                                                                                                                                                                                                               savedata.IFSC.ToUpper(), savedata.MICR.ToUpper(), savedata.Amountrupees, savedata.Refrence1, savedata.Refrence2, savedata.Phoneno, savedata.Email, savedata.PeriodFrom, savedata.PeriodTo, savedata.Customer1,
                                                                                                                                                                                                                                                                               savedata.Customer2, savedata.Customer3, savedata.UMRNDATE, savedata.MandateMode, savedata.Amount, savedata.Catagorycode, mandateid));
                }
                return(Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #28
0
 public Dictionary <string, object> CheckIsPresentmentChecker(string EntityId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Entity]").With <Checker>().With <AccessRights>().With <AccessRights>().Execute("@QueryType", "@EntityId", "CheckIsPresentmentChecker", DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #29
0
 public Dictionary <string, object> Edit(string mandateid, string UserId, string EntityId)
 {
     try
     {
         var Result = Common.Getdata(dbcontext.MultipleResults("[dbo].[Sp_Mandate]").With <EditData0>().With <EditData1>().With <EditData2>().With <EditData3>().With <EditData4>().Execute("@QueryType", "@MandateId", "@UserId", "@EntityId", "EditMandate", mandateid, DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(UserId.Replace("_", "%"))), DbSecurity.Decrypt(HttpContext.Current.Server.UrlDecode(EntityId.Replace("_", "%")))));
         return(Result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #30
0
        public ActionResult BindOrderType(string OrderType)
        {
            string orderType = DbSecurity.Decrypt(OrderType);

            return(Json(orderType, JsonRequestBehavior.AllowGet));
        }