public ReceptionStaffReg GetStaffDetailsByAdmin(int rId)
        {
            try
            {
                SqlParameter[] sqlparam;
                sqlparam    = new SqlParameter[1];
                sqlparam[0] = new SqlParameter("@ReceptionID", rId);

                DataTable         ds  = CommonFunction.GetDataTable("USP_Get_StaffDeatilsByAdmin", sqlparam, "");
                ReceptionStaffReg lst = new ReceptionStaffReg();
                if (ds != null && ds.Rows.Count > 0)
                {
                    DataTable dt = ds;
                    foreach (DataRow dr in dt.Rows)
                    {
                        //PatientDetails Model = new PatientDetails();
                        CommonFunction.ReflectSingleData(lst, dr);
                    }
                }
                return(lst);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
        public List <ReceptionStaffReg> GetStaffDetails(int HospitalId)
        {
            try
            {
                SqlParameter[] sqlparam;
                sqlparam    = new SqlParameter[2];
                sqlparam[0] = new SqlParameter("@Flag", "1");
                sqlparam[1] = new SqlParameter("@HospitalId", HospitalId);


                DataTable ds = CommonFunction.GetDataTable("USP_Get_StaffDeatilsByAdmin", sqlparam, "");
                List <ReceptionStaffReg> lst = new List <ReceptionStaffReg>();
                if (ds != null && ds.Rows.Count > 0)
                {
                    DataTable dt = ds;
                    foreach (DataRow dr in dt.Rows)
                    {
                        ReceptionStaffReg Model = new ReceptionStaffReg();
                        CommonFunction.ReflectSingleData(Model, dr);
                        lst.Add(Model);
                    }
                }
                return(lst);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
        public ActionResult ManageStaffDetails(ReceptionStaffReg PD)
        {
            try
            {
                AdminDetails admObj = (AdminDetails)Session["UserDetails"];
                PD.CreatedBy        = admObj.FirstName;
                PD.HospitalId       = admObj.HospitalId;
                PD.HostClincName    = admObj.HostClincName;
                PD.HospClinicAddess = admObj.HospClinicAddess;
                PD.HospClinicNumber = admObj.HospClinicNumber;
                PD.ParentId         = admObj.UserId;
                PD.CreatedBy        = admObj.FirstName;
                //string str = admObj.HostClincName.Substring(0, 3);
                //PD.CasePapaerNo = str;
                int Flag = BP.ManageStaffDetails(PD);
                if (Flag != 1)
                {
                    return(View());
                }

                StaffCount(admObj.HospitalId, admObj.UserId);
                if (PD.ReceptionId == 0)
                {
                    //List<ReceptionStaffReg> LST = new List<ReceptionStaffReg>();
                    //LST = BP.GetStaffDetails(admObj.HospitalId);

                    //var StaffRegNo = LST.Where(x
                    //             => x.HospitalId == PD.HospitalId
                    //             && x.WhatsAppNumber == PD.WhatsAppNumber
                    //              && x.Name == PD.Name
                    //             )
                    //         .OrderByDescending(x => x.Id)
                    //         .Take(1)
                    //         .Select(x => x.CasePapaerNo)
                    //         .ToList()
                    //         .FirstOrDefault();


                    SMS sms = new SMS();
                    //string message = "Dear "+PD.Name+", You are added to  " + admObj.HostClincName + ", Download eSmartDoctor app to manage - http://bit.ly/2RGTEHTR ";
                    string message = "Dear " + PD.Name + ", this is to inform you that you are added to" + admObj.HostClincName + ", login to esmartdoctor.com - TECHBULB";
                    sms.SendSMS(PD.WhatsAppNumber, message);
                }
                return(RedirectToAction("ViewAllStaff", "StaffDetails"));
            }
            catch (Exception)
            {
                throw;
            }
        }
 public ActionResult GetStaffById(int ReceptionId)
 {
     try
     {
         AdminDetails      admObj = (AdminDetails)Session["UserDetails"];
         ReceptionStaffReg pd     = new ReceptionStaffReg();
         pd = BP.GetStaffDetailsByAdmId(ReceptionId);
         StaffCount(admObj.HospitalId, admObj.UserId);
         return(View("StaffRegistration", pd));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public int ManageStaffDetails(ReceptionStaffReg PD)
        {
            try
            {
                SqlParameter[] sqlparam;
                sqlparam     = new SqlParameter[21];
                sqlparam[0]  = new SqlParameter("@ReceptionId", PD.ReceptionId);
                sqlparam[1]  = new SqlParameter("@ParentId", PD.ParentId);
                sqlparam[2]  = new SqlParameter("@HospitalId", PD.HospitalId);
                sqlparam[3]  = new SqlParameter("@HostClincName", PD.HostClincName);
                sqlparam[4]  = new SqlParameter("@HospClinicAddess", PD.HospClinicAddess);
                sqlparam[5]  = new SqlParameter("@HospClinicNumber", PD.HospClinicNumber);
                sqlparam[6]  = new SqlParameter("@Name", PD.Name);
                sqlparam[7]  = new SqlParameter("@Gender", PD.Gender);
                sqlparam[8]  = new SqlParameter("@DateOfBirth", PD.DateOfBirth);
                sqlparam[9]  = new SqlParameter("@WhatsAppNumber", PD.WhatsAppNumber);
                sqlparam[10] = new SqlParameter("@OtherNumber", PD.OtherNumber);
                sqlparam[11] = new SqlParameter("@Education", PD.Education);
                sqlparam[12] = new SqlParameter("@Department", PD.Department);
                sqlparam[13] = new SqlParameter("@Designation", PD.Designation);
                sqlparam[14] = new SqlParameter("@EmailId", PD.EmailId);
                sqlparam[15] = new SqlParameter("@Password", PD.Password);
                sqlparam[16] = new SqlParameter("@Remark", PD.Remark);
                sqlparam[17] = new SqlParameter("@Address", PD.Address);
                sqlparam[18] = new SqlParameter("@RoleId", PD.RoleId);
                sqlparam[19] = new SqlParameter("@CreatedBy", PD.CreatedBy);
                if (PD.isActive == true)
                {
                    sqlparam[20] = new SqlParameter("@isActive", "1");
                }
                else
                {
                    sqlparam[20] = new SqlParameter("@isActive", "0");
                }

                return(CommonFunction.Save("USP_MANGE_RECEPTIONSTAFFDETAILS", sqlparam, ""));
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #6
0
 public int ManageStaffDetails(ReceptionStaffReg PD)
 {
     return(DP.ManageStaffDetails(PD));
 }