Beispiel #1
0
        public string SaveFeeTerm(FeeHead FH)
        {
            string result = "";

            try
            {
                cmd             = new SqlCommand("USP_FEE_HEADS");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@FeeTerm", FH.FeeTerm);
                cmd.Parameters.Add("@Refundable", SqlDbType.Int, Convert.ToInt32(FH.Refundable));
                cmd.Parameters.Add("@Active", SqlDbType.Int, Convert.ToInt32(FH.Active));
                cmd.Parameters.AddWithValue("@SchoolID", FH.SchoolID);
                cmd.Parameters.AddWithValue("@CreatedBy", FH.CreatedBy);
                cmd.Parameters.AddWithValue("@Action", FH.Action);
                result = Convert.ToString(DBHelper.ExecuteScalar(cmd));
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALFee(SaveFeeTerm)", "Error_014", ex, "DALFee");
            }
            finally
            {
                cmd.Dispose();
            }
            return(result);
        }
Beispiel #2
0
        private static string OrganisationBody(OragnisationMaster _OragnisationMaster, string Password)
        {
            string Body = "";

            try
            {
                Body += "Thank you for registering. ";
                Body += "<br /><br />";
                Body += "Please find credentials to login.";
                Body += "<br />";
                Body += "<b>User Name: </b>" + _OragnisationMaster.LEmailId;
                Body += "<br />";
                Body += "<b>Password: </b>" + AESEncrytDecry.DecryptStringAES(Password);
                Body += "<br /><br />";
                Body += "<b>URL: </b>" + ConfigurationManager.AppSettings["WebSite"].ToString().Trim();
                Body += "<br /><br />";
                Body += "Our executive will contact you and after verification, we will activate your account.";
                Body += "<br />";
                Body += "Note:- Please change your password after successful login.";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Header)", "Error_014", ex, "BALMail");
                Body = "";
            }
            return(Body);
        }
Beispiel #3
0
        public List <FeeHead> GetFeeHeads(FeeHead FH)
        {
            List <FeeHead> obj = new List <FeeHead>();

            try
            {
                cmd             = new SqlCommand("USP_FEE_HEADS");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SchoolID", FH.SchoolID);
                cmd.Parameters.AddWithValue("@CreatedBy", FH.CreatedBy);
                cmd.Parameters.AddWithValue("@Action", FH.Action);
                var dr = DBHelper.ExecuteReader(cmd);
                while (dr.Read())
                {
                    obj.Add(new FeeHead
                    {
                        SchoolID   = Convert.ToString(dr["SchoolID"]),
                        FeeTerm    = Convert.ToString(dr["FeeTerm"]),
                        Active     = Convert.ToBoolean(dr["Active"]),
                        Refundable = Convert.ToBoolean(dr["Refundable"]),
                        CreatedBy  = Convert.ToString(dr["CreatedBy"]),
                    });
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALFee(SaveFeeTerm)", "Error_014", ex, "DALFee");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
Beispiel #4
0
        private static string UserRegistrationBody(UserMasters model, string Password)
        {
            string Body = "";

            try
            {
                Body += "Thank you for registering. ";
                Body += "<br /><br />";
                Body += "Please find credentials to login.";
                Body += "<br />";
                Body += "<b>User Name: </b>" + model.USERNAME;
                Body += "<br />";
                Body += "<b>Password: </b>" + AESEncrytDecry.DecryptStringAES(Password);
                Body += "<br /><br />";
                Body += "<b>URL: </b>" + ConfigurationManager.AppSettings["WebSite"].ToString().Trim();
                Body += "<br /><br />";
                Body += "Note:- Please change your password after successful login.";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Header)", "Error_014", ex, "BALMail");
                Body = "";
            }
            return(Body);
        }
        public int InsertUpdateRouteDetails(RouteDetails model)
        {
            int result = 0;

            try
            {
                cmd             = new SqlCommand("USP_Route");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SchoolID", model.SchoolID);
                cmd.Parameters.AddWithValue("@FinancialYearID", model.FinancialYearID);
                cmd.Parameters.AddWithValue("@RouteID", model.RouteID);
                cmd.Parameters.AddWithValue("@RouteName", model.RouteName);
                cmd.Parameters.AddWithValue("@VehicleID", model.VehicleID);
                cmd.Parameters.AddWithValue("@IsActive", model.IsActive);
                cmd.Parameters.AddWithValue("@Action", model.Action);
                cmd.Parameters.AddWithValue("@CreatedBy", model.CreatedBy);
                result = Convert.ToInt32(DBHelper.ExecuteScalar(cmd));
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALTransport(InsertUpdateDriverDetails)", "Error_014", ex, "DALTransport");
            }
            finally
            {
                cmd.Dispose();
            }
            return(result);
        }
        public int InsertUpdatePickDropPointDetails(List <PickDropPoint> Points)
        {
            int result = 0;

            try
            {
                foreach (var model in Points)
                {
                    cmd             = new SqlCommand("USP_PickDropPoint");
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@SchoolID", model.SchoolID);
                    cmd.Parameters.AddWithValue("@FinancialYearID", model.FinancialYearID);
                    cmd.Parameters.AddWithValue("@PickDropID", model.PickDropID);
                    cmd.Parameters.AddWithValue("@PickDropPointName", model.PickDropPointName);
                    cmd.Parameters.AddWithValue("@PickupTime", model.PickupTime);
                    cmd.Parameters.AddWithValue("@DropTime", model.DropTime);
                    cmd.Parameters.AddWithValue("@Fee", model.Fee);
                    cmd.Parameters.AddWithValue("@RouteID", model.RouteID);
                    cmd.Parameters.AddWithValue("@IsActive", model.IsActive);
                    cmd.Parameters.AddWithValue("@Action", model.Action);
                    cmd.Parameters.AddWithValue("@CreatedBy", model.CreatedBy);
                    result += Convert.ToInt32(DBHelper.ExecuteScalar(cmd));
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALTransport(InsertUpdateDriverDetails)", "Error_014", ex, "DALTransport");
            }
            finally
            {
                cmd.Dispose();
            }
            return(result);
        }
Beispiel #7
0
 public ActionResult AddVehicle(VehicleDetails VehicleDetail, FormCollection collection)
 {
     try
     {
         VehicleDetail.SchoolID        = _OrgnisationID;
         VehicleDetail.FinancialYearID = _Financialyearid;
         VehicleDetail.CreatedBy       = WebSecurity.CurrentUserName;
         if (collection["btntype"].ToUpper() == "Save".ToUpper())
         {
             VehicleDetail.Action = "INS";
         }
         else if (collection["btntype"].ToUpper() == "Update".ToUpper())
         {
             VehicleDetail.Action = "UPD";
         }
         int res = BALObj.InsertUpdateVehicleDetails(VehicleDetail);
         if (res < 0)
         {
             TempData[Constants.MessageInfo.WARNING] = "Vehicle is already exists.";
         }
         else if (res == 0)
         {
             TempData[Constants.MessageInfo.WARNING] = "Unable to " + collection["btntype"].ToLower();
         }
         else
         {
             TempData[Constants.MessageInfo.SUCCESS] = res + ((res == 1) ? " record " : " records ") + collection["btntype"].ToLower() + " successfully.";
         }
     }
     catch (Exception ex)
     {
         ExecptionLogger.FileHandling("Transport(AddVehicle_Post)", "Error_014", ex, "Transport");
     }
     return(RedirectToAction("VehicleMaster"));
 }
        public JsonResult SaveFeeTerm(string FeeTerm, int Refundable, int Active)
        {
            FeeHead FH = new FeeHead();
            ChannelFactory <ICommonSrv> CF    = new ChannelFactory <ICommonSrv>("COMMON");
            ChannelFactory <IFeeSrv>    CFFee = new ChannelFactory <IFeeSrv>("FEE");
            ICommonSrv CSvc         = (ICommonSrv)CF.CreateChannel();
            IFeeSrv    CSFee        = (IFeeSrv)CFFee.CreateChannel();
            string     actionStatus = "";

            try
            {
                UserMasters userMasters = CSvc.getUserProfile(WebSecurity.CurrentUserName);
                FH.FeeTerm    = FeeTerm;
                FH.Refundable = Convert.ToBoolean(Refundable);
                FH.Active     = Convert.ToBoolean(Active);
                FH.Action     = "INS";
                FH.CreatedBy  = WebSecurity.CurrentUserName;
                FH.SchoolID   = userMasters.SchoolID;
                actionStatus  = CSFee.SaveFeeTerm(FH);
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("Fee(SaveFeeTerm)", "Error_014", ex, "Fee");
            }
            finally
            {
                CF.Close();
                CFFee.Close();
            }
            return(Json(actionStatus, JsonRequestBehavior.AllowGet));
        }
        public List <DriverDetails> GetDriverList(Driver model)
        {
            List <DriverDetails> obj = new List <DriverDetails>();

            #region GEt All Vehicle
            Vehicle VehicleModel = new Vehicle();
            VehicleModel.SchoolID        = model.SchoolID;
            VehicleModel.FinancialYearID = model.FinancialYearID;
            VehicleModel.Action          = "GET";
            List <VehicleDetails> VehicleObj = new List <VehicleDetails>();
            VehicleObj = GetVehicleList(VehicleModel);
            #endregion Get All Vehicle


            DALFee objDALFee = new DALFee(ConStr);
            List <EmployeeMaster> EmployeeList = objDALFee.GetEmployeeList(1, model.SchoolID);
            try
            {
                cmd             = new SqlCommand("USP_Driver");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SchoolID", model.SchoolID);
                cmd.Parameters.AddWithValue("@FinancialYearID", model.FinancialYearID);
                cmd.Parameters.AddWithValue("@VehicleID", (model.DriverDetailList != null && model.DriverDetailList.Count() > 0) ? model.DriverDetailList[0].DriverID : 0);
                cmd.Parameters.AddWithValue("@Action", model.Action);
                var dr = DBHelper.ExecuteReader(cmd);
                while (dr.Read())
                {
                    obj.Add(new DriverDetails
                    {
                        DriverID         = Convert.ToInt32(dr["DriverID"]),
                        Name             = Convert.ToString(dr["Name"]),
                        DOB              = Convert.ToString(dr["DOB"]),
                        PresentAddress   = Convert.ToString(dr["PresentAddress"]),
                        PermanentAddress = Convert.ToString(dr["PermanentAddress"]),
                        Phone            = Convert.ToString(dr["Phone"]),
                        EmployeeID       = Convert.ToInt32(dr["EmployeeID"]),
                        IsEmployee       = Convert.ToString(dr["IsEmployee"]),
                        LicenseNo        = Convert.ToString(dr["LicenseNo"]),
                        SchoolID         = Convert.ToInt32(dr["SchoolID"]),
                        FinancialYearID  = Convert.ToInt32(dr["FinancialYearID"]),
                        CreatedBy        = Convert.ToString(dr["CreatedBy"]),
                        VehicleID        = Convert.ToInt32(dr["VehicleID"]),
                        IsActive         = Convert.ToString(dr["IsActive"]),
                        VehicleDetail    = VehicleObj.Where(x => x.VehicleID == Convert.ToInt32(dr["VehicleID"])).FirstOrDefault(),
                        EmployeeDetail   = EmployeeList.Where(x => x.EMP_ID == Convert.ToInt32(dr["EmployeeID"])).FirstOrDefault()
                    });
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALTransport(GetVehicleList)", "Error_014", ex, "DALTransport");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
Beispiel #10
0
 //[ValidateAntiForgeryToken]
 //[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
 public ActionResult Login(LoginModel model, string returnUrl)
 {
     try
     {
         //WebSecurity.CurrentUserName
         // WebSecurity.CurrentUserId
         //ChannelFactory<IMembershipSrv> CF = new ChannelFactory<IMembershipSrv>("MEMBERSHIP");
         //IMembershipSrv CSvc = (IMembershipSrv)CF.CreateChannel();
         //SHARED.UserProfile userProfile = new SHARED.UserProfile();
         //userProfile = CSvc.GetUserProfile(model.UserName);
         //CF.Close();
         if (ModelState.IsValid && WebSecurity.Login(model.UserName, AESEncrytDecry.DecryptStringAES(model.Password), persistCookie: model.RememberMe))
         {
             //ChannelFactory<ICommonSrv> CF = new ChannelFactory<ICommonSrv>("COMMON");
             //ICommonSrv CSvc = (ICommonSrv)CF.CreateChannel();
             BALCommon CSvc = new BALCommon(ConStr);
             try
             {
                 UserMasters userMasters = CSvc.getUserProfile(model.UserName);
                 //CF.Close();
                 if (!userMasters.ISACTIVE)
                 {
                     TempData["Msg"] = "Please Contact To Technical Team.";
                     WebSecurity.Logout();
                 }
                 else
                 {
                     if (model.FID > 0 && CSvc.InsertUpdateSession(model.UserName, model.FID) == 1)
                     {
                         return(RedirectToAction("Index", "Home"));
                     }
                     else
                     {
                         WebSecurity.Logout();
                     }
                 }
             }
             catch (Exception ex)
             {
                 WebSecurity.Logout();
                 ExecptionLogger.FileHandling("Account(UserLogin_getUserProfilePost)", "Error_014", ex, "Account");
             }
         }
         else
         {
             TempData["Msg"] = "UserName and/or Password is incorrect.";
         }
     }
     catch (Exception ex)
     {
         WebSecurity.Logout();
         ExecptionLogger.FileHandling("Account(UserLoginPost)", "Error_014", ex, "Account");
     }
     //return View(model);
     return(RedirectToAction("Login"));
 }
Beispiel #11
0
 public ActionResult Logout()
 {
     try
     {
         if (WebSecurity.CurrentUserId != 0)
         {
             WebSecurity.Logout();
         }
     }
     catch (Exception ex)
     { ExecptionLogger.FileHandling("Account(LogOff)", "Error_014", ex, "Account"); }
     return(RedirectToAction("Login", "Account"));
 }
Beispiel #12
0
        public static bool SendMail(MailDetails MailDetails)
        {
            bool flag = false;

            System.Net.Mail.SmtpClient  objMail = new System.Net.Mail.SmtpClient();
            System.Net.Mail.MailMessage msgMail = new System.Net.Mail.MailMessage();
            msgMail.To.Clear();
            try
            {
                var    fromAddress  = new MailAddress(ConfigurationManager.AppSettings["MailUID"].ToString().Trim(), ConfigurationManager.AppSettings["MailUName"].ToString().Trim());
                string fromPassword = ConfigurationManager.AppSettings["MailPassword"].ToString().Trim();

                if (!string.IsNullOrEmpty(MailDetails.ToMailIDs))
                {
                    foreach (var MailID in MailDetails.ToMailIDs.Split(','))
                    {
                        if (!string.IsNullOrEmpty(MailID.Trim()))
                        {
                            msgMail.To.Add(new System.Net.Mail.MailAddress(MailID.Trim()));
                        }
                    }
                }

                var smtp = new SmtpClient
                {
                    Host                  = Convert.ToString(ConfigurationManager.AppSettings["Host"].ToString().Trim()),//"smtp.gmail.com",
                    Port                  = Convert.ToInt32(ConfigurationManager.AppSettings["Port"].ToString().Trim()),
                    EnableSsl             = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"].ToString().Trim()),
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(fromAddress.Address, fromPassword)
                };
                using (var message = new MailMessage(fromAddress.Address, msgMail.To.ToString())
                {
                    Subject = MailDetails.Subject,
                    IsBodyHtml = MailDetails.HTMLBody,
                    Body = MailDetails.Body,
                })
                {
                    smtp.Send(message);
                    flag = true;
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(sendMail)", "Error_014", ex, "BALMail");
                flag = false;
            }
            return(flag);
        }
Beispiel #13
0
        private static string Footer(string FooterName)
        {
            string footer = "";

            try
            {
                footer += "<b>Thanks & Regards," + "<br /> <br />" + FooterName + "</b>";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Footer)", "Error_014", ex, "BALMail");
                footer = "";
            }
            return(footer);
        }
Beispiel #14
0
        private static string Header(string HeaderName)
        {
            string header = "";

            try
            {
                header += "Dear " + HeaderName + ",";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Header)", "Error_014", ex, "BALMail");
                header = "";
            }
            return(header);
        }
        public OragnisationMaster GetOragnisationAlready(string LEmailId)
        {
            OragnisationMaster _lst = new OragnisationMaster();

            try
            {
                cmd             = new SqlCommand("SP_Orgnisationmexist");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@LEmailId", LEmailId);
                var reader = DBHelper.ExecuteReader(cmd);
                while (reader.Read())
                {
                    _lst.OMID         = DBNull.Value != reader["OMID"] ? (int)reader["OMID"] : default(int);
                    _lst.Oname        = DBNull.Value != reader["Oname"] ? (string)reader["Oname"] : default(string);
                    _lst.BOAddress    = DBNull.Value != reader["BOAddress"] ? (string)reader["BOAddress"] : default(string);
                    _lst.BOAddress2   = DBNull.Value != reader["BOAddress2"] ? (string)reader["BOAddress2"] : default(string);
                    _lst.BOCity       = DBNull.Value != reader["BOCity"] ? (int)reader["BOCity"] : default(int);
                    _lst.BOPincode    = DBNull.Value != reader["BOPincode"] ? (string)reader["BOPincode"] : default(string);
                    _lst.LCountry     = DBNull.Value != reader["LCountry"] ? (int)reader["LCountry"] : default(int);
                    _lst.LState       = DBNull.Value != reader["LState"] ? (int)reader["LState"] : default(int);
                    _lst.LDistict     = DBNull.Value != reader["LDistict"] ? (string)reader["LDistict"] : default(string);
                    _lst.LArea        = DBNull.Value != reader["LArea"] ? (string)reader["LArea"] : default(string);
                    _lst.LEmailId     = DBNull.Value != reader["LEmailId"] ? (string)reader["LEmailId"] : default(string);
                    _lst.LMobile      = DBNull.Value != reader["LMobile"] ? (string)reader["LMobile"] : default(string);
                    _lst.LPhone       = DBNull.Value != reader["LPhone"] ? (string)reader["LPhone"] : default(string);
                    _lst.LWebsite     = DBNull.Value != reader["LWebsite"] ? (string)reader["LWebsite"] : default(string);
                    _lst.OAfficilate  = DBNull.Value != reader["OAfficilate"] ? (string)reader["OAfficilate"] : default(string);
                    _lst.OlicNo       = DBNull.Value != reader["OlicNo"] ? (string)reader["OlicNo"] : default(string);
                    _lst.OTaxNo       = DBNull.Value != reader["OTaxNo"] ? (string)reader["OTaxNo"] : default(string);
                    _lst.OPanNo       = DBNull.Value != reader["OPanNo"] ? (string)reader["OPanNo"] : default(string);
                    _lst.OContactNo   = DBNull.Value != reader["OContactNo"] ? (string)reader["OContactNo"] : default(string);
                    _lst.IsActive     = DBNull.Value != reader["IsActive"] ? (bool)reader["IsActive"] : default(bool);
                    _lst.Createddate  = DBNull.Value != reader["Createddate"] ? (DateTime)reader["Createddate"] : default(DateTime);
                    _lst.CreatedBy    = DBNull.Value != reader["CreatedBy"] ? (string)reader["CreatedBy"] : default(string);
                    _lst.Modifieddate = DBNull.Value != reader["Modifieddate"] ? (DateTime)reader["Modifieddate"] : default(DateTime);
                    _lst.ModifiedBy   = DBNull.Value != reader["ModifiedBy"] ? (string)reader["ModifiedBy"] : default(string);
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(OragnasitionBasicopation)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(_lst);
        }
 public ActionResult Login(string returnUrl)
 {
     try
     {
         if (WebSecurity.CurrentUserId != 0)
         {
             WebSecurity.Logout();
         }
         ViewBag.ReturnUrl = returnUrl;
     }
     catch (Exception ex)
     {
         ExecptionLogger.FileHandling("Account(UserLogin)", "Error_007", ex, "Account");
     }
     return(View());
 }
Beispiel #17
0
        public RoleMaster  GetByRoleId(int roleId, int SchoolID)
        {
            RoleMaster _rmobj = new RoleMaster();
            DataSet    _ds    = new DataSet();
            SqlCommand cmd    = new SqlCommand("USP_MENUPERMISION_GETBYROLEID");

            try
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@RoleId", roleId);
                cmd.Parameters.AddWithValue("@SchoolID", SchoolID);
                ds = DBHelper.ExecuteDataSet(cmd);
                if (ds != null && ds.Tables.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        _rmobj.ROLE_ID         = Convert.ToInt32(ds.Tables[0].Rows[i]["ROLE_ID"]);
                        _rmobj.ROLENAME        = Convert.ToString(ds.Tables[0].Rows[i]["ROLENAME"]);
                        _rmobj.ROLEDESCRIPTION = Convert.ToString(ds.Tables[0].Rows[i]["ROLEDESCRIPTION"]);
                        _rmobj.ISACTIVE        = Convert.ToBoolean(ds.Tables[0].Rows[i]["ISACTIVE"]);
                        _rmobj.CREATEDBY       = Convert.ToString(ds.Tables[0].Rows[i]["CREATEDBY"]);
                        _rmobj.CREATEDDATE     = Convert.ToDateTime(ds.Tables[0].Rows[i]["CREATEDDATE"]);
                    }

                    if (ds.Tables[1].Rows.Count > 0)
                    {
                        _rmobj.MenuPermissionList = new List <MenuPermissionMapMaster>();
                        for (int j = 0; j < ds.Tables[1].Rows.Count; j++)
                        {
                            _rmobj.MenuPermissionList.Add(new MenuPermissionMapMaster {
                                MENU_ID       = Convert.ToInt32(ds.Tables[1].Rows[j]["MENU_ID"]),
                                PERMISSION_ID = Convert.ToInt32(ds.Tables[1].Rows[j]["PERMISSION_ID"])
                            });
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(GetByRoleId)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(_rmobj);
        }
Beispiel #18
0
        public string  UpdateRole(RoleMaster rolemaster, List <MenuPermissionMapMaster> menupermissionList)
        {
            string     result = "";
            SqlCommand cmd    = new SqlCommand("USP_Addupdrolewithmenu");

            try
            {
                DataSet _ds = new DataSet();

                DataTable _mstmenupermission = new DataTable();
                if (menupermissionList != null)
                {
                    _mstmenupermission.Columns.Add("MID", typeof(int));//Auto genrated for sample
                    _mstmenupermission.Columns.Add("MENU_ID", typeof(int));
                    _mstmenupermission.Columns.Add("PERMISSION_ID", typeof(int));
                    int increment = 1;
                    foreach (var item in menupermissionList)
                    {
                        DataRow dr = _mstmenupermission.NewRow();
                        dr[0] = increment;
                        dr[1] = item.MENU_ID;
                        dr[2] = item.PERMISSION_ID;
                        _mstmenupermission.Rows.Add(dr);
                        increment = increment + 1;
                    }
                }
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ROLE_ID", rolemaster.ROLE_ID);
                cmd.Parameters.AddWithValue("@ROLENAME", rolemaster.ROLENAME);
                cmd.Parameters.AddWithValue("@SchoolID", rolemaster.SchoolID);
                cmd.Parameters.AddWithValue("@ROLEDESCRIPTION", rolemaster.ROLEDESCRIPTION);
                cmd.Parameters.AddWithValue("@ISACTIVE", rolemaster.ISACTIVE);
                cmd.Parameters.AddWithValue("@CREATEDBY", rolemaster.CREATEDBY);
                cmd.Parameters.AddWithValue("@CREATEDDATE", rolemaster.CREATEDDATE);
                cmd.Parameters.AddWithValue("@menupermissionList", _mstmenupermission);
                result = Convert.ToString(DBHelper.ExecuteScalar(cmd));
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("RoleDB(UpdateRole)", "Error_014", ex, "UpdateRole");
            }
            finally
            {
                cmd.Dispose();
            }
            return(result);
        }
        public List <MenuMaster> GetAllMenuListByUserId(int userId)
        {
            List <MenuMaster> obj = new List <MenuMaster>();

            ds = new DataSet();
            try
            {
                //  cmd = new SqlCommand("usp_MENU_GetAllMenuListByUserId");
                cmd             = new SqlCommand("USP_MENU_GETALLMENULISTBYROLEBYUSERID");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserId", userId);
                ds = DBHelper.ExecuteDataSet(cmd);
                if (ds != null && ds.Tables.Count == 1)
                {
                    for (int l = 0; l < ds.Tables[0].Rows.Count; l++)
                    {
                        obj.Add(new MenuMaster
                        {
                            CREATEDBY    = Convert.ToString(ds.Tables[0].Rows[l]["CreatedBy"]),
                            CREATEDDATE  = Convert.ToDateTime(ds.Tables[0].Rows[l]["CreatedDate"]),
                            DISPLAYORDER = Convert.ToInt32(ds.Tables[0].Rows[l]["DisplayOrder"]),
                            IMAGEPATH    = Convert.ToString(ds.Tables[0].Rows[l]["ImagePath"]),
                            ISACTIVE     = Convert.ToBoolean(ds.Tables[0].Rows[l]["IsActive"]),
                            //ISDISPLAY = Convert.ToString(ds.Tables[0].Rows[l][""]),
                            MENUCODE     = Convert.ToString(ds.Tables[0].Rows[l]["MenuCode"]),
                            MENUNAME     = Convert.ToString(ds.Tables[0].Rows[l]["MenuName"]),
                            MENU_ID      = Convert.ToInt32(ds.Tables[0].Rows[l]["Menu_Id"]),
                            PAGETITLE    = Convert.ToString(ds.Tables[0].Rows[l]["PageTitle"]),
                            PARENTMENUID = Convert.ToInt32(ds.Tables[0].Rows[l]["ParentMenuID"]),
                            //  PermissionList = Convert.ToString(ds.Tables[0].Rows[l]["Permissions"]),
                            PermissionNameList = !string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[l]["Permissions"])) ? Convert.ToString(ds.Tables[0].Rows[l]["Permissions"]).Split(',').ToList() : null,
                            //Permissions = Convert.ToString(ds.Tables[0].Rows[l][""]),
                            URL = Convert.ToString(ds.Tables[0].Rows[l]["URL"]),
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(GetAllMenuListByUserId)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
        public int OragnasitionBasicopation(OragnisationMaster _Omaster)
        {
            int rettype = -1;

            try
            {
                cmd             = new SqlCommand("SP_Orgnisationmaster");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@OMID", _Omaster.OMID);
                cmd.Parameters.AddWithValue("@Oname", _Omaster.Oname);
                cmd.Parameters.AddWithValue("@BOAddress", _Omaster.BOAddress);
                cmd.Parameters.AddWithValue("@BOAddress2", _Omaster.BOAddress2);
                cmd.Parameters.AddWithValue("@BOCity", _Omaster.BOCity);
                cmd.Parameters.AddWithValue("@BOPincode", _Omaster.BOPincode);
                cmd.Parameters.AddWithValue("@LCountry", _Omaster.LCountry);
                cmd.Parameters.AddWithValue("@LState", _Omaster.LState);
                cmd.Parameters.AddWithValue("@LDistict", _Omaster.LDistict);
                cmd.Parameters.AddWithValue("@LArea", _Omaster.LArea);
                cmd.Parameters.AddWithValue("@LEmailId", _Omaster.LEmailId);
                cmd.Parameters.AddWithValue("@LMobile", _Omaster.LMobile);
                cmd.Parameters.AddWithValue("@LPhone", _Omaster.LPhone);
                cmd.Parameters.AddWithValue("@LWebsite", _Omaster.LWebsite);
                cmd.Parameters.AddWithValue("@OAfficilate", _Omaster.OAfficilate);
                cmd.Parameters.AddWithValue("@OlicNo", _Omaster.OlicNo);
                cmd.Parameters.AddWithValue("@OTaxNo", _Omaster.OTaxNo);
                cmd.Parameters.AddWithValue("@OPanNo", _Omaster.OPanNo);
                cmd.Parameters.AddWithValue("@OContactNo", _Omaster.OContactNo);
                cmd.Parameters.AddWithValue("@IsActive", _Omaster.IsActive);
                cmd.Parameters.AddWithValue("@Createddate", _Omaster.Createddate);
                cmd.Parameters.AddWithValue("@CreatedBy", _Omaster.CreatedBy);
                cmd.Parameters.AddWithValue("@Modifieddate", _Omaster.Modifieddate);
                cmd.Parameters.AddWithValue("@ModifiedBy", _Omaster.ModifiedBy);
                cmd.Parameters.AddWithValue("@OrgImage", _Omaster.OrgImage);
                cmd.Parameters.AddWithValue("@Otype", _Omaster.Otype);
                rettype = DBHelper.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(OragnasitionBasicopation)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(rettype);
        }
Beispiel #21
0
        public ActionResult RouteMaster()
        {
            Route model = new Route();

            try
            {
                model.SchoolID        = _OrgnisationID;
                model.FinancialYearID = _Financialyearid;
                model.Action          = "GET";
                model.RouteDetailList = BALObj.GetRouteList(model);
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("Transport(VehicleMasterGet)", "Error_014", ex, "Transport");
            }
            return(View(model));
        }
Beispiel #22
0
        private static string ResetOTPBody(UserMasters userMasters, string OTP)
        {
            string Body = "";

            try
            {
                Body += "<b>User Name: </b>" + userMasters.USERNAME;
                Body += "<br />";
                Body += "<b>OTP: </b>" + AESEncrytDecry.DecryptStringAES(OTP);
                Body += "<br /><br />";
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(Header)", "Error_014", ex, "BALMail");
                Body = "";
            }
            return(Body);
        }
Beispiel #23
0
        public JsonResult GetGeoDetails(string PinCode)
        {
            GEO       obj   = new GEO();
            BALCommon CScmn = new BALCommon(ConStr);

            try
            {
                obj = CScmn.GetGeoDetails(PinCode);
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("Fee(GetGeoDetails)", "Error_014", ex, "Fee");
            }
            finally
            {
            }
            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
        public TransportDetails GetAssignTransport(TransportDetails model)
        {
            TransportDetails obj = new TransportDetails();

            try
            {
                cmd             = new SqlCommand("USP_AssignTransport");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SchoolID", model.SchoolID);
                cmd.Parameters.AddWithValue("@FinancialYearID", model.FinancialYearID);
                cmd.Parameters.AddWithValue("@TPCostID", model.TPCostID);
                cmd.Parameters.AddWithValue("@Action", model.Action);
                var dr = DBHelper.ExecuteReader(cmd);
                while (dr.Read())
                {
                    obj.TPCostID        = Convert.ToInt32(dr["TPId"]);
                    obj.FinancialYearID = Convert.ToInt32(dr["FinancialYearID"]);
                    obj.RouteID         = Convert.ToInt32(dr["RouteID"]);
                    obj.PickDropPointID = Convert.ToInt32(dr["PickDropPointId"]);
                    obj.Fee             = Convert.ToDecimal(dr["Fee"]);
                    obj.Apr             = Convert.ToDecimal(dr["Apr"]);
                    obj.May             = Convert.ToDecimal(dr["May"]);
                    obj.Jun             = Convert.ToDecimal(dr["Jun"]);
                    obj.Jul             = Convert.ToDecimal(dr["Jul"]);
                    obj.Aug             = Convert.ToDecimal(dr["Aug"]);
                    obj.Sep             = Convert.ToDecimal(dr["Sep"]);
                    obj.Oct             = Convert.ToDecimal(dr["Oct"]);
                    obj.Nov             = Convert.ToDecimal(dr["Nov"]);
                    obj.Dec             = Convert.ToDecimal(dr["Dec"]);
                    obj.Jan             = Convert.ToDecimal(dr["Jan"]);
                    obj.Feb             = Convert.ToDecimal(dr["Feb"]);
                    obj.Mar             = Convert.ToDecimal(dr["Mar"]);
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALTransport(GetVehicleList)", "Error_014", ex, "DALTransport");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
        public List <VehicleDetails> GetVehicleList(Vehicle model)
        {
            List <VehicleDetails> obj = new List <VehicleDetails>();

            try
            {
                cmd             = new SqlCommand("USP_Vehicle");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SchoolID", model.SchoolID);
                cmd.Parameters.AddWithValue("@FinancialYearID", model.FinancialYearID);
                cmd.Parameters.AddWithValue("@VehicleID", (model.VehicleDetailList != null && model.VehicleDetailList.Count() > 0) ? model.VehicleDetailList[0].VehicleID : 0);
                cmd.Parameters.AddWithValue("@Action", model.Action);
                var dr = DBHelper.ExecuteReader(cmd);
                while (dr.Read())
                {
                    obj.Add(new VehicleDetails
                    {
                        AllowedSeats         = Convert.ToInt32(dr["AllowedSeats"]),
                        CCTV                 = Convert.ToString(dr["CCTV"]),
                        GPS                  = Convert.ToString(dr["GPS"]),
                        InsuranceExpiry      = Convert.ToString(dr["InsuranceExpiry"]),
                        IsActive             = Convert.ToString(dr["IsActive"]),
                        OwnershipType        = Convert.ToString(dr["OwnershipType"]),
                        PollutionExpiry      = Convert.ToString(dr["PollutionExpiry"]),
                        TotalSeats           = Convert.ToInt32(dr["TotalSeats"]),
                        VehicleSpecification = Convert.ToString(dr["VehicleSpecification"]),
                        VehicleID            = Convert.ToInt32(dr["VehicleID"]),
                        State                = Convert.ToString(dr["State"]),
                        Sequential           = Convert.ToString(dr["Sequential"]),
                        RTO                  = Convert.ToString(dr["RTO"]),
                        UniqueNo             = Convert.ToString(dr["UniqueNo"]),
                    });
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALTransport(GetVehicleList)", "Error_014", ex, "DALTransport");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
        public UserMasters GetUserProfile(string UserName)
        {
            UserMasters obj = new UserMasters();

            obj.ISACTIVE = false;
            ds           = new DataSet();
            try
            {
                cmd             = new SqlCommand("USP_GetUserProfile");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserName", UserName);
                ds = DBHelper.ExecuteDataSet(cmd);
                if (ds != null && ds.Tables.Count == 1)
                {
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        obj.ADDRESS    = Convert.ToString(ds.Tables[0].Rows[0]["ADDRESS"]);
                        obj.CITY_ID    = Convert.ToInt32(ds.Tables[0].Rows[0]["CITY_ID"]);
                        obj.COUNTRY_ID = Convert.ToInt32(ds.Tables[0].Rows[0]["COUNTRY_ID"]);
                        obj.CREATEDBY  = Convert.ToString(ds.Tables[0].Rows[0]["UpdatedBy"]);
                        obj.EMAILID    = Convert.ToString(ds.Tables[0].Rows[0]["EmailId"]);
                        obj.FISRTNAME  = Convert.ToString(ds.Tables[0].Rows[0]["Name"]);
                        obj.IMAGE      = Convert.ToString(ds.Tables[0].Rows[0]["IMAGE"]);

                        obj.LASTNAME = Convert.ToString(ds.Tables[0].Rows[0]["Lastname"]);
                        // //obj.MenuPermissionList = !string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]
                        obj.ROLE_ID  = Convert.ToInt32(ds.Tables[0].Rows[0]["RoleId"]);
                        obj.STATE_ID = Convert.ToInt32(ds.Tables[0].Rows[0]["STATE_ID"]);
                        obj.USERNAME = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
                        obj.UserId   = Convert.ToInt32(ds.Tables[0].Rows[0]["UserId"]);
                        obj.ISACTIVE = Convert.ToBoolean(ds.Tables[0].Rows[0]["ISACTIVE"]);
                    }
                }
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("DALCommon(GetUserProfile)", "Error_014", ex, "DALCommon");
            }
            finally
            {
                cmd.Dispose();
            }
            return(obj);
        }
Beispiel #27
0
        public static string TemplateUserRegistration(UserMasters model, string Password)
        {
            string HTML = "";

            try
            {
                HTML += Header(model.USERNAME);
                HTML += "<br /><br />";
                HTML += UserRegistrationBody(model, Password);
                HTML += "<br /><br /><br /><br />";
                HTML += Footer("igenussolution Team");
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(TemplateOrganisation)", "Error_014", ex, "BALMail");
                HTML = "";
            }
            return(HTML);
        }
Beispiel #28
0
        public static string TemplateOrganisation(OragnisationMaster _OragnisationMaster, string Password)
        {
            string HTML = "";

            try
            {
                HTML += Header(_OragnisationMaster.OContactNo);
                HTML += "<br /><br />";
                HTML += OrganisationBody(_OragnisationMaster, Password);
                HTML += "<br /><br /><br /><br />";
                HTML += Footer("igenussolution Team");
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(TemplateOrganisation)", "Error_014", ex, "BALMail");
                HTML = "";
            }
            return(HTML);
        }
Beispiel #29
0
        public static string TemplateResetOTP(UserMasters userMasters, string OTP)
        {
            string HTML = "";

            try
            {
                HTML += Header(userMasters.FISRTNAME + " " + userMasters.LASTNAME);
                HTML += "<br /><br />";
                HTML += ResetOTPBody(userMasters, OTP);
                HTML += "<br /><br /><br /><br />";
                HTML += Footer("igenussolution Team");
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("BALMail(TemplateOrganisation)", "Error_014", ex, "BALMail");
                HTML = "";
            }
            return(HTML);
        }
Beispiel #30
0
        public ActionResult Login(string returnUrl)
        {
            BALCommon CSvc = new BALCommon(ConStr);

            try
            {
                if (WebSecurity.CurrentUserId != 0)
                {
                    WebSecurity.Logout();
                }
                List <FinancialYear> FYList = CSvc.GetFinancialYearList();
                TempData["FinancialYearList"]    = FYList;
                TempData["CurrentFinancialYear"] = FYList.Where(x => x.SelectedYear).Select(x => x.FID).FirstOrDefault();
                ViewBag.ReturnUrl = returnUrl;
            }
            catch (Exception ex)
            {
                ExecptionLogger.FileHandling("Account(UserLogin)", "Error_007", ex, "Account");
            }
            return(View());
        }