Beispiel #1
0
        public ActionResult ChannelList()
        {
            if (Session["username"] == null)
            {
                BO_Employee obj = new BO_Employee();

                return(RedirectToAction("Index", "Home"));
            }


            List <BO_Message_Recipients_Status> li = new List <BO_Message_Recipients_Status>();

            try
            {
                BO_Message_Recipients_Status MSR_Result = new BO_Message_Recipients_Status();
                MSR_Result = DA_Login.DA_MessageRecipientStatus();

                if (MSR_Result.msg != null)
                {
                    ViewBag.Exception = MSR_Result.msg;
                }
                //  MSR_Result = DB.Channellist();
                li.Add(MSR_Result);
            }
            catch (Exception e)
            {
                ViewBag.Exception = e;
            }
            return(View("ChannelList", "_Layout", li));
        }
Beispiel #2
0
        public ActionResult employee1()
        {
            try
            {
                if (Session["username"] == null)
                {
                    BO_Employee obj = new BO_Employee();

                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch (Exception)
            {
            }

            return(View("employee1", "_Layout"));
        }
Beispiel #3
0
        public ActionResult Create_Post()
        {
            BO_Employee employee = new BO_Employee();
            bool        result   = TryUpdateModel <BO_Employee>(employee);

            EmployeeBusinessLayer employeeBusinessLayer = new EmployeeBusinessLayer();

            //Response.Write(result.ToString() + "<br/> Name : " + employee.Name + "<br/> Age : " + employee.Age.ToString() + "<br/> Gender : " + employee.Gender);
            int rowsInserted = employeeBusinessLayer.InsertEmployee(employee);

            //return View();
            if (rowsInserted > 0)
            {
                return(RedirectToAction("BO_Index"));
            }
            else
            {
                return(View());
            }
        }
Beispiel #4
0
        public ActionResult login(string empcd, string password)
        {
            BO_Employee objResult = new BO_Employee();

            try
            {
                objResult = DA_Login.DA_LoginEmployee(empcd, password);

                if (objResult.Empcd != null && objResult.Password != null)
                {
                    // if (obj.Empcd.Trim() == objResult.Empcd.Trim() && obj.Password.Trim() == objResult.Password.Trim())
                    if (empcd.Trim() == objResult.Empcd.Trim() && password.Trim() == objResult.Password.Trim())
                    {
                        // Session["EntryBy"] = obj.Empcd;
                        Session["EntryBy"]  = objResult.Empcd;
                        Session["Password"] = objResult.Password;
                        Session["username"] = objResult.Empnm;

                        TempData["success"] = 1;

                        return(RedirectToAction("Home"));

                        //if (objResult.Empcd.Trim() == "A786KEY")
                        //{
                        //    ViewBag.flag = 1;
                        //}
                        // return View("main", "_Layout");
                    }
                }



                ViewBag.fail = 0;
            }
            catch (Exception e)
            {
                ViewBag.Exception = e;
                // throw;
            }
            return(View("Index"));
        }
Beispiel #5
0
        public JsonResult Update_Password(string current_Password, string new_Password, string confirm_Password)
        {
            BO_Employee objResult = new BO_Employee();

            try
            {
                string emcd     = Session["EntryBy"].ToString();
                string Password = Session["Password"].ToString();
                // objResult = DA_Login.DA_LoginEmployee(emcd, old_Password);

                if (Password == current_Password.Trim())
                {
                    if (new_Password.Trim() == confirm_Password.Trim())
                    {
                        if (current_Password != new_Password.Trim())
                        {
                            DB.Update_Password(new_Password, emcd);
                            Session.Clear();
                            return(Json("Updated Successfully..."));
                        }
                        else
                        {
                            return(Json("New password must different from Current password"));
                        }
                    }
                    else
                    {
                        return(Json("Re-type Password Not Matched..."));
                    }
                }
                else
                {
                    return(Json("Current Password InCorrect..."));
                }
            }
            catch (Exception e)
            {
                return(Json("Exception..."));
            }
        }
        // public static BO_Employee DA_LoginEmployee(BO_Employee obj)
        public static BO_Employee DA_LoginEmployee(string empcd, string password)
        {
            BO_Employee objEmployee = new BO_Employee();
            DataTable   dt          = new DataTable();

            string[] param = new string[] { "@Empcd", "@pwd" }; //A786KEY,!nland@123  //K587SAV ,keshav@123
                                                                //  string[] ParamValues = new string[] { obj.Empcd, obj.Password };
            string[] ParamValues = new string[] { empcd, password };
            dt = SQL_Helper.Select("LongHaul..Usp_Admin_login", param, ParamValues, "MySqlConnection");
            if (dt.Rows.Count > 0)
            {
                objEmployee = new BO_Employee()
                {
                    Empcd        = Convert.ToString(dt.Rows[0]["USERID"]),
                    Password     = Convert.ToString(dt.Rows[0]["PWD"]),
                    Empnm        = Convert.ToString(dt.Rows[0]["Empnm"]),
                    CustomerCode = Convert.ToString(dt.Rows[0]["CUSTOMERCODE"]),
                    USERROLE     = Convert.ToString(dt.Rows[0]["USERROLE"])
                };
            }
            return(objEmployee);
        }
Beispiel #7
0
        public ActionResult CreateMessage()
        {
            if (Session["username"].ToString() == null)
            {
                return(RedirectToAction("Index", "Home"));
            }



            //image display code from database in byte format to image

            //DataTable ds1 = DB.Pending_pics();
            //if (ds1 != null)
            //{
            //    // byte[] ImagemByte = (byte[])ds1.Rows[0][8];
            //    // MemoryStream ms = new MemoryStream(ImagemByte);
            //    // String base64 = Convert.ToBase64String(ImagemByte);
            //    // var imgSrc = String.Format("data:image/jpg;base64,{0}", base64);
            //    var imgSrc = ds1.Rows[0][3];
            //    VigewBag.image = imgSrc;

            //    //var pdf = ds1.Rows[0][8].ToString();
            //    //ViewBag.pdf = pdf;

            //}



            if (Session["username"] == null)
            {
                BO_Employee obj = new BO_Employee();

                return(RedirectToAction("Index", "Home"));
            }

            return(View());
        }