예제 #1
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);
            }
        }
예제 #2
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");
            }
        }
예제 #3
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);
        }
예제 #4
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;
            }
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string UserId = DbSecurity.Decrypt(Request.QueryString["Id"]);
         ViewState["UserId"] = UserId;
     }
 }
예제 #6
0
        public ActionResult BindPaymentPage(string restroid, string orderId)
        {
            string UserId = CurrentUser.User.UserId.ToString();
            var    result = 0;

            string OrderId = DbSecurity.Encrypt(orderId);

            return(Json(OrderId, JsonRequestBehavior.AllowGet));
        }
예제 #7
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));
        }
예제 #8
0
 protected void btnChangePassword_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtPassword.Text == txtConfirmPassword.Text)
         {
             if (txtPassword.Text.Length >= 6)
             {
                 ChangePassword = DbSecurity.Encrypt(txtPassword.Text, ref changePasswordKey);
                 //int Text = objManager.IntMethodWithParam("Sp_UserLogin", "@QueryType", "@ChangePassword", "@ChangePasswordKey",
                 //    "@UserId", "UpdatePassword", ChangePassword, changePasswordKey, ViewState["UserId"].ToString());
                 var results = context.MultipleResults("[dbo].[Sp_UserLogin]").With <DefaultPasswordChange>().Execute("@QueryType", "@ChangePassword", "@ChangePasswordKey",
                                                                                                                      "@UserId", "UpdatePassword", ChangePassword, changePasswordKey, ViewState["UserId"].ToString());
                 foreach (var data in results)
                 {
                     dataList_value = data.Cast <DefaultPasswordChange>().ToList();
                 }
                 dt_value = ToDataTable(dataList_value);
                 if (Convert.ToInt32(dt_value.Rows[0]["value"]) >= 0)
                 {
                     HdnIndustries.Value = "Y";
                     //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Updated Successfuly !!');window.location ='Login.aspx';", true);
                     //Response.Redirect("~/Login.aspx");
                     txtConfirmPassword.Text = "";
                     txtPassword.Text        = "";
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Updated Unsuccessfuly !!')", true);
                 }
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Minimum Length Of Password Is 6 !!')", true);
                 txtConfirmPassword.Text = "";
                 txtPassword.Text        = "";
                 // popup1.Visible = true;
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('New Password Does Not Match To Confirm Password !!')", true);
             txtConfirmPassword.Text = "";
             txtPassword.Text        = "";
             //  popup1.Visible = true;
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #9
0
        public DataSet SaveEmployee(string EmailId, string EmpCode, string EmpName, string mobileNo, string kitchensectionId, string restroId, string UserPin, string Password, string ConfirmPassword, string UserName, string AccessCode, string RoleId)

        {
            //ImageData = "00";
            string PasswordKey = string.Empty;
            string AccessKey   = string.Empty;

            Password   = DbSecurity.Encrypt(Password, ref PasswordKey);
            AccessCode = DbSecurity.Encrypt(AccessCode, ref AccessKey);
            ds         = objManager.FillDatasetWithParam("Sp_GetEmployee", "@QueryType", "@emailId", "@EmpCode", "@EmpName", "@mobileNo", "@KitchenSectionId", "@restroId", "@userpin", "@password", "@passwordkey", "@username", "@accesscode", "@accesskey", "@RoleId ", "SaveEmployee", EmailId, EmpCode, EmpName, mobileNo, kitchensectionId, restroId, UserPin, Password, PasswordKey, UserName, AccessCode, AccessKey, RoleId);

            return(ds);
        }
예제 #10
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();
        }
예제 #11
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;
            }
        }
예제 #12
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);
        }
예제 #13
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;
            }
        }
예제 #14
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;
            }
        }
예제 #15
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;
            }
        }
예제 #16
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;
     }
 }
예제 #17
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;
     }
 }
예제 #18
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;
     }
 }
예제 #19
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;
            }
        }
예제 #20
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;
            }
        }
예제 #21
0
        public IEnumerable <CommonFlag> SendMail(string Username)
        {
            try
            {
                List <Value> dataList = new List <Value>(); List <UserDetails> dataList1 = new List <UserDetails>();
                var          Result = dbcontext.MultipleResults("[dbo].[Sp_UserLogin]").With <Value>().With <UserDetails>().Execute("@QueryType", "@EmailId", "ChkEmail", Username);

                dataList  = Result.FirstOrDefault().Cast <Value>().ToList();
                dataList1 = Result.LastOrDefault().Cast <UserDetails>().ToList();
                if (dataList.Cast <Value>().ToList().Select(x => x.value).First().ToString() == "1")
                {
                    if (dataList1.Count > 0)
                    {
                        using (StringWriter sw = new StringWriter())
                        {
                            using (HtmlTextWriter hw = new HtmlTextWriter(sw))
                            {
                                StringBuilder sb            = new StringBuilder();
                                string        WebAppUrl     = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
                                string        SMTPHost      = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
                                string        UserId        = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
                                string        MailPassword  = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
                                string        SMTPPort      = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
                                string        SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
                                string        FromMailId    = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
                                string        Teamtext      = ConfigurationManager.AppSettings["Team"].ToString();
                                sb.Append("Dear " + dataList1.Cast <UserDetails>().ToList().Select(x => x.UserName).First().ToString() + ",<br> <br>");
                                sb.Append("Please click on the below button to set a new Password . <br> <br>");
                                string User = HttpContext.Current.Server.UrlEncode(DbSecurity.Encrypt(dataList1.Cast <UserDetails>().ToList().Select(x => x.UserId).First().ToString())).Replace("%", "_");
                                sb.Append("<a href=' " + WebAppUrl + "ChangePassword/" + User + "' target='_blank'>");
                                sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");

                                SmtpClient  smtpClient  = new SmtpClient();
                                MailMessage mailmsg     = new MailMessage();
                                MailAddress mailaddress = new MailAddress(FromMailId);
                                mailmsg.To.Add(Username);
                                mailmsg.From = mailaddress;

                                mailmsg.Subject    = "Recover Password";
                                mailmsg.IsBodyHtml = true;
                                mailmsg.Body       = sb.ToString();

                                smtpClient.Host                  = SMTPHost;
                                smtpClient.Port                  = Convert.ToInt32(SMTPPort);
                                smtpClient.EnableSsl             = Convert.ToBoolean(SMTPEnableSsl);
                                smtpClient.UseDefaultCredentials = true;
                                smtpClient.Credentials           = new System.Net.NetworkCredential(UserId, MailPassword);
                                smtpClient.Send(mailmsg);
                                QuickCheckEmandate_AngularEntities dbcontext = new QuickCheckEmandate_AngularEntities();
                                dbcontext.MultipleResults("[dbo].[Sp_SendEmail]").With <Value>().Execute("@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");
                                Flag.Flag = "1";
                                common.Add(Flag);
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                Flag.Flag = "1";
                common.Add(Flag);
            }

            return(common);
        }
        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;
            }
        }
예제 #23
0
        public int CreateUser(string UserName, string UserEmail, string UserAccount, string UserId)
        {
            try
            {
                string Password    = string.Empty;
                string PasswordKey = string.Empty;
                //int value = CommonManger.IntMethodWithParam("Sp_BankBulkUpload", "@QueryType", "@MandateId", "@UserId", "CancelMandate", MandateId, DbSecurity.Decrypt(UserId));
                //return value;
                Password = DbSecurity.Encrypt(UserEmail.Split('@').ElementAtOrDefault(0), ref PasswordKey);
                var results_Password = context.MultipleResults("[dbo].[Sp_user]").With <DefaultPasswordChange>().Execute("@QueryType", "@UserName", "@EmailId", "@AccountNo", "@UserId", "@UserType", "@Password", "@PasswordKey", "SaveData", UserName, UserEmail, UserAccount, UserId, "1", Password, PasswordKey);

                foreach (var data in results_Password)
                {
                    dataList_Save_value = data.Cast <DefaultPasswordChange>().ToList();
                }
                dt_Save_value = ToDataTable(dataList_Save_value);

                if (Convert.ToInt32(dt_Save_value.Rows[0]["value"]) != -1)
                {
                    StringBuilder sb               = new StringBuilder();
                    string        smtpAddress      = "smtp.gmail.com";
                    int           portNumber       = 587;
                    bool          enableSSL        = true;
                    string        emailFromAddress = "*****@*****.**"; //Sender Email Address
                    string        password         = "******";              //Sender Password
                    //string emailToAddress = "*****@*****.**"; //Receiver Email Address
                    string subject   = "User New Password";
                    string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();


                    sb.Append("Dear " + UserName + ",<br> <br>");
                    sb.Append("Please find your new Password is --   " + UserEmail.Split('@').ElementAtOrDefault(0) + " <br> <br>");

                    //  string User = DbSecurity.Encrypt(dt.Rows[0]["UserId"].ToString());
                    //sb.Append("<a href='" + WebAppUrl + "changepassword.aspx?Id=" + User + "' target='_blank'>");
                    //sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");

                    using (MailMessage mail = new MailMessage())
                    {
                        mail.From = new MailAddress(emailFromAddress);
                        mail.To.Add(UserEmail);
                        mail.Subject    = subject;
                        mail.Body       = sb.ToString();
                        mail.IsBodyHtml = true;
                        //mail.Attachments.Add(new Attachment("D:\\TestFile.txt"));//--Uncomment this to send any attachment
                        using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber))
                        {
                            smtp.Credentials = new NetworkCredential(emailFromAddress, password);
                            smtp.EnableSsl   = enableSSL;
                            smtp.Send(mail);
                        }
                    }


                    // For mail purpose start
                    //using (StringWriter sw = new StringWriter())
                    //{
                    //    using (HtmlTextWriter hw = new HtmlTextWriter(sw))
                    //    {
                    //        StringBuilder sb = new StringBuilder();
                    //        string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
                    //        string SMTPHost = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
                    //        string UserId_Mail = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
                    //        string MailPassword = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
                    //        string SMTPPort = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
                    //        string SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
                    //        string FromMailId = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
                    //        string Teamtext = ConfigurationManager.AppSettings["Team"].ToString();

                    //        sb.Append("Dear " + UserName + ",<br> <br>");
                    //        sb.Append("Please find your new Password is --   " + UserEmail.Split('@').ElementAtOrDefault(0) + " <br> <br>");

                    //        //  string User = DbSecurity.Encrypt(dt.Rows[0]["UserId"].ToString());
                    //        //sb.Append("<a href='" + WebAppUrl + "changepassword.aspx?Id=" + User + "' target='_blank'>");
                    //        //sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");

                    //        SmtpClient smtpClient = new SmtpClient();
                    //        MailMessage mailmsg = new MailMessage();
                    //        MailAddress mailaddress = new MailAddress(FromMailId);
                    //        mailmsg.To.Add(UserEmail);
                    //        mailmsg.From = mailaddress;

                    //        mailmsg.Subject = "Recover Password";
                    //        mailmsg.IsBodyHtml = true;
                    //        mailmsg.Body = sb.ToString();

                    //        smtpClient.Host = SMTPHost;
                    //        smtpClient.Port = Convert.ToInt32(SMTPPort);
                    //        smtpClient.EnableSsl = Convert.ToBoolean(SMTPEnableSsl);
                    //        smtpClient.UseDefaultCredentials = true;
                    //        smtpClient.Credentials = new System.Net.NetworkCredential(UserId_Mail, MailPassword);
                    //       //smtpClient.Send(mailmsg);
                    //        //  CommonManger.FillDatasetWithParam("Sp_SendEmail", "@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");

                    //    }
                    //}
                }
                return(Convert.ToInt32(dt_Save_value.Rows[0]["value"]));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        // 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;
            }
        }
예제 #25
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;
     }
 }
예제 #26
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;
     }
 }
예제 #27
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;
     }
 }
예제 #28
0
        protected void btnAgree_Click(object sender, EventArgs e)
        {
            if (txtRecoverEmail.Text != "")
            {
                FAMSEntities          context        = new FAMSEntities();
                List <UserDetailCode> dataList_value = new List <UserDetailCode>();
                List <UserDetails>    dataList       = new List <UserDetails>();
                DataTable             dt_value;
                DataTable             dt;
                try
                {
                    var results = context.MultipleResults("[dbo].[Sp_UserLogin]").With <UserDetailCode>().With <UserDetails>()
                                  .Execute("@QueryType", "@EmailId", "ChkEmail", txtRecoverEmail.Text);
                    int i = 0;
                    foreach (var data in results)
                    {
                        i++;
                        if (i == 1)
                        {
                            dataList_value = data.Cast <UserDetailCode>().ToList();
                        }
                        else
                        {
                            dataList = data.Cast <UserDetails>().ToList();
                        }
                    }
                    dt_value = ToDataTable(dataList_value);
                    dt       = ToDataTable(dataList);
                }
                catch (Exception)
                {
                    throw;
                }


                //  DataSet ds = CommonManger.FillDatasetWithParam("Sp_UserLogin", "@QueryType", "@EmailId", "ChkEmail", txtRecoverEmail.Text);
                // if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == 1)
                if (dt_value.Rows.Count > 0 && dt_value != null && Convert.ToInt32(dt_value.Rows[0]["value"]) == 1)
                {
                    // if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null)
                    if (dt.Rows.Count > 0 && dt != null)
                    {
                        StringBuilder sb               = new StringBuilder();
                        string        smtpAddress      = "smtp.gmail.com";
                        int           portNumber       = 587;
                        bool          enableSSL        = true;
                        string        emailFromAddress = "*****@*****.**"; //Sender Email Address
                        string        password         = "******";              //Sender Password
                        string        emailToAddress   = "*****@*****.**";  //Receiver Email Address
                        string        subject          = "Recover Password";
                        string        WebAppUrl        = ConfigurationManager.AppSettings["WebAppUrl"].ToString();

                        sb.Append("Dear " + dt.Rows[0]["UserName"].ToString() + ",<br> <br>");
                        sb.Append("Please click on the below button to set a new Password . <br> <br>");

                        string User = DbSecurity.Encrypt(dt.Rows[0]["UserId"].ToString());
                        sb.Append("<a href='" + WebAppUrl + "changepassword.aspx?Id=" + User + "' target='_blank'>");
                        sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");
                        // string body = "Hello, This is Email sending test using gmail.";
                        using (MailMessage mail = new MailMessage())
                        {
                            mail.From = new MailAddress(emailFromAddress);
                            mail.To.Add(txtRecoverEmail.Text);
                            mail.Subject    = subject;
                            mail.Body       = sb.ToString();
                            mail.IsBodyHtml = true;
                            //mail.Attachments.Add(new Attachment("D:\\TestFile.txt"));//--Uncomment this to send any attachment
                            using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber))
                            {
                                smtp.Credentials = new NetworkCredential(emailFromAddress, password);
                                smtp.EnableSsl   = enableSSL;
                                smtp.Send(mail);
                            }
                        }
                        //using (StringWriter sw = new StringWriter())
                        //{
                        //    using (HtmlTextWriter hw = new HtmlTextWriter(sw))
                        //    {
                        //        StringBuilder sb = new StringBuilder();
                        //        string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
                        //        string SMTPHost = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
                        //        string UserId = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
                        //        string MailPassword = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
                        //        string SMTPPort = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
                        //        string SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
                        //        string FromMailId = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
                        //        string Teamtext = ConfigurationManager.AppSettings["Team"].ToString();

                        //        sb.Append("Dear " + dt.Rows[0]["UserName"].ToString() + ",<br> <br>");
                        //        sb.Append("Please click on the below button to set a new Password . <br> <br>");

                        //        string User = DbSecurity.Encrypt(dt.Rows[0]["UserId"].ToString());
                        //        sb.Append("<a href='" + WebAppUrl + "changepassword.aspx?Id=" + User + "' target='_blank'>");
                        //        sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");

                        //        SmtpClient smtpClient = new SmtpClient();
                        //        MailMessage mailmsg = new MailMessage();
                        //        MailAddress mailaddress = new MailAddress(FromMailId);
                        //        mailmsg.To.Add(txtRecoverEmail.Text);
                        //        mailmsg.From = mailaddress;

                        //        mailmsg.Subject = "Recover Password";
                        //        mailmsg.IsBodyHtml = true;
                        //        mailmsg.Body = sb.ToString();

                        //        smtpClient.Host = SMTPHost;
                        //        smtpClient.Port = Convert.ToInt32(SMTPPort);
                        //        smtpClient.EnableSsl = Convert.ToBoolean(SMTPEnableSsl);
                        //        smtpClient.UseDefaultCredentials = true;
                        //        smtpClient.Credentials = new System.Net.NetworkCredential(UserId, MailPassword);
                        //        //smtpClient.Send(mailmsg);
                        //        //  CommonManger.FillDatasetWithParam("Sp_SendEmail", "@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");

                        //    }
                        //}
                    }
                    txtRecoverEmail.Text = "";
                    HdnIndustries.Value  = "Y";
                    //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "ShowPopup()", true);
                    //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "ShowPopup();", true);
                    //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>ShowMailPopup();</script>", false);
                    // ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "ShowPopup();", true);
                }
                //    //else if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == 2)
                //    //{
                //    //    if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null)
                //    //    {
                //    //        using (StringWriter sw = new StringWriter())
                //    //        {
                //    //            using (HtmlTextWriter hw = new HtmlTextWriter(sw))
                //    //            {
                //    //                StringBuilder sb = new StringBuilder();
                //    //                string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
                //    //                string SMTPHost = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
                //    //                string UserId = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
                //    //                string MailPassword = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
                //    //                string SMTPPort = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
                //    //                string SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
                //    //                string FromMailId = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
                //    //                string Teamtext = ConfigurationManager.AppSettings["Team"].ToString();
                //    //                sb.Append("Dear Sir/Mam ,<br> <br>");
                //    //                sb.Append(" " + ds.Tables[1].Rows[0]["Name"].ToString() + " has requested to set a new password. Please click on the below button to set a new Password. <br> <br>");

                //    //                string User = DbSecurity.Encrypt(ds.Tables[1].Rows[0]["UserId"].ToString());
                //    //                sb.Append("<a href='" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "' target='_blank'>");
                //    //                sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");
                //    //                SmtpClient smtpClient = new SmtpClient();
                //    //                MailMessage mailmsg = new MailMessage();
                //    //                MailAddress mailaddress = new MailAddress(FromMailId);
                //    //                mailmsg.To.Add(ds.Tables[2].Rows[0]["EmailId"].ToString());
                //    //                mailmsg.From = mailaddress;
                //    //                mailmsg.Subject = "Recover Password";
                //    //                mailmsg.IsBodyHtml = true;
                //    //                mailmsg.Body = sb.ToString();
                //    //                smtpClient.Host = SMTPHost;
                //    //                smtpClient.Port = Convert.ToInt32(SMTPPort);
                //    //                smtpClient.EnableSsl = Convert.ToBoolean(SMTPEnableSsl);
                //    //                smtpClient.UseDefaultCredentials = true;
                //    //                smtpClient.Credentials = new System.Net.NetworkCredential(UserId, MailPassword);
                //    //                smtpClient.Send(mailmsg);
                //    //                CommonManger.FillDatasetWithParam("Sp_SendEmail", "@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");

                //    //            }
                //    //        }
                //    //    }
                //    //    txtEmail_Zipnach.Text = "";
                //    //    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Email is sent to Admin !!')", true);
                //    //}
                //    else if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == -1)
                //    {
                //        txtRecoverEmail.Text = "";
                //        ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Not exist!!!')", true);
                //    }

                //}
                //else
                //{

                //}
            }
            //protected void btnAgree_Click(object sender, EventArgs e)
            //{
            //    FAMSEntities context = new FAMSEntities();

            //    if (txtEmail.Value != "")
            //    {
            //        var results = context.MultipleResults("[dbo].[Sp_DemoReport]").With<SummaryReportExcel>()
            //.Execute("@Querytype", "@CustomerAccount", "@Fromdate", "@Todate", "GetSummaryReportDataExcel", Session["UserName"].ToString(), fromdate, todate);
            //        DataSet ds = CommonManger.FillDatasetWithParam("Sp_UserLogin", "@QueryType", "@EmailId", "ChkEmail", txtEmail.Value);
            //        if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == 1)
            //        {
            //            if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null)
            //            {
            //                using (StringWriter sw = new StringWriter())
            //                {
            //                    using (HtmlTextWriter hw = new HtmlTextWriter(sw))
            //                    {
            //                        StringBuilder sb = new StringBuilder();
            //                        string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
            //                        string SMTPHost = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
            //                        string UserId = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
            //                        string MailPassword = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
            //                        string SMTPPort = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
            //                        string SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
            //                        string FromMailId = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
            //                        string Teamtext = ConfigurationManager.AppSettings["Team"].ToString();

            //                        //string User = DbSecurity.Encrypt(ds.Tables[1].Rows[0]["UserId"].ToString());

            //                        //sb.Append("Dear " + ds.Tables[1].Rows[0]["UserName"].ToString() + ",<br> <br>");
            //                        //sb.Append("Please click on the below button to set a new Password . <br> <br>");
            //                        //sb.Append("<a href='" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "' target='_blank'>");
            //                        //sb.Append("<input style='background-color: #3965a9;color: #fff;padding: 3px 10px 3px 10px;' type='button' value='Change Password' /></a> </div>");
            //                        string User = DbSecurity.Encrypt(ds.Tables[1].Rows[0]["UserId"].ToString());
            //                        sb.Append("Hi " + ds.Tables[1].Rows[0]["UserName"].ToString() + ",<br> <br>");
            //                        sb.Append("We have received a request to reset your password. In case you have not initiated such request, you should ignore this email.<br/>");
            //                        sb.Append("Reset your password by clicking on this link:");
            //                        sb.Append("<a href='" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "' target='_blank'>" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "/> <br/>");

            //                        sb.Append("Thanks<br/>");
            //                        sb.Append("Team " + Convert.ToString(ConfigurationManager.AppSettings["Team"]));
            //                        sb.Append("<br/>");
            //                        sb.Append("<i style='font-size:11px'>(Email Generated from Unattendable MailBox, Please Do Not reply.)</i>");

            //                        SmtpClient smtpClient = new SmtpClient();
            //                        MailMessage mailmsg = new MailMessage();
            //                        MailAddress mailaddress = new MailAddress(FromMailId);
            //                        mailmsg.To.Add(txtEmail.Value);
            //                        mailmsg.From = mailaddress;

            //                        mailmsg.Subject = "Reset your QuickCheck Password";
            //                        mailmsg.IsBodyHtml = true;
            //                        mailmsg.Body = sb.ToString();

            //                        smtpClient.Host = SMTPHost;
            //                        smtpClient.Port = Convert.ToInt32(SMTPPort);
            //                        smtpClient.EnableSsl = Convert.ToBoolean(SMTPEnableSsl);
            //                        smtpClient.UseDefaultCredentials = true;
            //                        smtpClient.Credentials = new System.Net.NetworkCredential(UserId, MailPassword);
            //                        smtpClient.Send(mailmsg);

            //                        CommonManger.FillDatasetWithParam("Sp_SendEmail", "@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");

            //                    }
            //                }
            //            }
            //            txtEmail.Value = "";
            //            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Email is sent!!!')", true);

            //        }
            //        else if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == 2)
            //        {
            //            if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null)
            //            {
            //                using (StringWriter sw = new StringWriter())
            //                {
            //                    using (HtmlTextWriter hw = new HtmlTextWriter(sw))
            //                    {
            //                        StringBuilder sb = new StringBuilder();
            //                        string WebAppUrl = ConfigurationManager.AppSettings["WebAppUrl"].ToString();
            //                        string SMTPHost = ConfigurationManager.AppSettings["Amazon_SMTPHost"].ToString();
            //                        string UserId = ConfigurationManager.AppSettings["Amazon_UserId"].ToString();
            //                        string MailPassword = ConfigurationManager.AppSettings["Amazon_MailPassword"].ToString();
            //                        string SMTPPort = ConfigurationManager.AppSettings["Amazon_SMTPPort"].ToString();
            //                        string SMTPEnableSsl = ConfigurationManager.AppSettings["Amazon_SMTPEnableSsl"].ToString();
            //                        string FromMailId = ConfigurationManager.AppSettings["Amazon_FromMailId"].ToString();
            //                        string Teamtext = ConfigurationManager.AppSettings["Team"].ToString();

            //                        string User = DbSecurity.Encrypt(ds.Tables[1].Rows[0]["UserId"].ToString());
            //                        sb.Append("Hi " + ds.Tables[1].Rows[0]["UserName"].ToString() + ",<br> <br>");
            //                        sb.Append("We have received a request to reset your password. In case you have not initiated such request, you should ignore this email.<br/>");
            //                        sb.Append("Reset your password by clicking on this link:");
            //                        sb.Append("<a href='" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "' target='_blank'>" + WebAppUrl + "ChangePassword.aspx?Id=" + User + "/> <br/>");

            //                        sb.Append("Thanks<br/>");
            //                        sb.Append("Team " + Convert.ToString(ConfigurationManager.AppSettings["Team"]));
            //                        sb.Append("<br/>");
            //                        sb.Append("<i style='font-size:11px'>(Email Generated from Unattendable MailBox, Please Do Not reply.)</i>");

            //                        SmtpClient smtpClient = new SmtpClient();
            //                        MailMessage mailmsg = new MailMessage();
            //                        MailAddress mailaddress = new MailAddress(FromMailId);
            //                        mailmsg.To.Add(ds.Tables[2].Rows[0]["EmailId"].ToString());
            //                        mailmsg.From = mailaddress;
            //                        mailmsg.Subject = "Reset your QuickCheck Password";
            //                        mailmsg.IsBodyHtml = true;
            //                        mailmsg.Body = sb.ToString();
            //                        smtpClient.Host = SMTPHost;
            //                        smtpClient.Port = Convert.ToInt32(SMTPPort);
            //                        smtpClient.EnableSsl = Convert.ToBoolean(SMTPEnableSsl);
            //                        smtpClient.UseDefaultCredentials = true;
            //                        smtpClient.Credentials = new System.Net.NetworkCredential(UserId, MailPassword);
            //                        smtpClient.Send(mailmsg);
            //                        CommonManger.FillDatasetWithParam("Sp_SendEmail", "@QueryType", "@MandateId", "@EmailCount", "@SmsCount", "SendMail", Convert.ToString(0), "1", "0");

            //                    }
            //                }
            //            }
            //            txtEmail.Value = "";
            //            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Email is sent to Admin !!')", true);
            //        }
            //        else if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null && Convert.ToInt32(ds.Tables[0].Rows[0]["value"]) == -1)
            //        {
            //            txtEmail.Value = "";
            //            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Not exist!!!')", true);
            //        }

            //    }
            //    else
            //    {

            //    }
        }
        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;
            }
        }
예제 #30
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;
     }
 }