Ejemplo n.º 1
0
        public ActionResult LockReleaseDetails(string Lid)
        {
            if (Lid == null)
            {
                ViewBag.subDomainName   = _objCurrentInfo.GetSubDomain();
                ViewBag.Company_Code    = _objCurrentInfo.GetCompanyCode();
                ViewBag.LoginRegionCode = _objCurrentInfo.GetRegionCode();
                ViewBag.LoginUserCode   = _objCurrentInfo.GetUserCode();
                ViewBag.CompanyId       = _objCurrentInfo.GetCompanyId();
                ViewBag.IsResponsive    = "NO";
            }
            else
            {
                string parameters = System.Text.ASCIIEncoding.ASCII.GetString(System.Convert.FromBase64String(Lid));
                MVCModels.DoctorMissedReason.ParameterMode dd = Newtonsoft.Json.JsonConvert.DeserializeObject <MVCModels.DoctorMissedReason.ParameterMode>(parameters);


                ViewBag.subDomainName   = _objCurrentInfo.GetSubDomain();
                ViewBag.Company_Code    = _objCurrentInfo.GetCompanyCode();
                ViewBag.LoginRegionCode = _objCurrentInfo.GetRegionCode();
                ViewBag.LoginUserCode   = _objCurrentInfo.GetUserCode();
                ViewBag.CompanyId       = _objCurrentInfo.GetCompanyId();
                ViewBag.IsResponsive    = "NO";
            }
            return(View());
        }
Ejemplo n.º 2
0
 public ActionResult BirthdayMail()
 {
     ViewBag.CompanyCode     = _objCurrentInfo.GetCompanyCode();
     ViewBag.LoginRegionCode = _objCurrentInfo.GetRegionCode();
     ViewBag.LoginUserCode   = _objCurrentInfo.GetUserCode();
     ViewBag.CompanyId       = _objCurrentInfo.GetCompanyId();
     return(View());
 }
Ejemplo n.º 3
0
 public int SaveFormValue(MVCModels.Form_Value objFormValue)
 {
     objFormControls           = new BL_FormControls();
     objCurInfo                = new DataControl.CurrentInfo();
     objFormValue.Company_Code = objCurInfo.GetCompanyCode();
     objFormValue.Company_Id   = Convert.ToInt32(objCurInfo.GetCompanyId());
     objFormValue.Created_By   = objCurInfo.GetUserCode();
     return(objFormControls.SaveFormValue(objFormValue));
 }
Ejemplo n.º 4
0
 public ActionResult CPDLeave(string CPD_Date, int CPD_Id)
 {
     ViewBag.subDomainName   = _objCurrentInfo.GetSubDomain();
     ViewBag.CompanyId       = _objCurrentInfo.GetCompanyId();
     ViewBag.LoginRegionCode = _objCurrentInfo.GetRegionCode();
     ViewBag.LoginUserCode   = _objCurrentInfo.GetUserCode();
     ViewBag.CPD_Date        = CPD_Date;
     ViewBag.CPD_Id          = CPD_Id;
     return(View());
 }
Ejemplo n.º 5
0
        public string SendPassword(string userCode, string createdDate, string hiDoctorStartDate)
        {
            try
            {
                StringBuilder           sbTableContent = new StringBuilder();
                int                     successcount   = 0;
                int                     failurecount   = 0;
                string                  mesgalert      = string.Empty;
                string                  failure        = string.Empty;
                string                  url            = string.Empty;
                string                  message        = string.Empty;
                string                  userName       = string.Empty;
                string                  password       = string.Empty;
                string                  mobileno       = string.Empty;
                Regex                   regExInt       = new Regex("^([0-9]*)$");
                List <SendSMS>          lstUser        = new List <SendSMS>();
                DataControl.BLMaster    _objMapping    = new DataControl.BLMaster();
                DataControl.CurrentInfo _objCurInfo    = new DataControl.CurrentInfo();
                string                  companyCode    = _objCurInfo.GetCompanyCode();
                string                  companyId      = _objCurInfo.GetCompanyId();
                string                  senderCode     = _objCurInfo.GetUserCode();
                string                  senderName     = _objCurInfo.GetUserName();
                lstUser = (List <SendSMS>)_objMapping.GetUserDetails(companyCode, userCode);

                url = "https://" + Request.Url.DnsSafeHost;
                foreach (var user in lstUser)
                {
                    userCode = user.User_Code.ToString();
                    userName = user.User_Name.ToString();
                    password = user.User_Pass.ToString();
                    mobileno = user.Mobile.ToString();
                    message  = "Welcome to HiDoctor. Website address for online reporting: [variable1] Your user name is [variable2] and password is [variable3].";
                    message  = message.Replace("[variable1]", url).Replace("[variable2]", userName).Replace("[variable3]", password);

                    if (!string.IsNullOrEmpty(mobileno))
                    {
                        if (mobileno.Length == 10 && regExInt.IsMatch(mobileno))
                        {
                            HttpWebRequest request = (HttpWebRequest)
                                                     WebRequest.Create("http://www.smsintegra.co.in/smsweb/desktop_sms/desktopsms.asp?uid=swaassys&pwd=963900&mobile=" + mobileno + "&msg=" + message + "&sid=HIDOCT&dtNow=" + DateTime.Now.ToString("yyyy-MM-dd") + "");
                            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                            using (Stream responseStream = response.GetResponseStream())
                            {
                                using (StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8))
                                {
                                    string strSMSResponseString = readStream.ReadToEnd();

                                    if (strSMSResponseString.StartsWith("100"))
                                    {
                                        successcount++;
                                        _objMapping.SMSSentLog(companyCode, companyId, userCode, userName, senderCode, senderName, mobileno, message);
                                    }
                                    else
                                    {
                                        failurecount++;
                                        failure += "<tr><td> " + userName + "</td><td>" + mobileno + "</td><td>Due to technical reasons unable to send SMS</td></tr>";
                                    }
                                }
                            }
                        }
                        else
                        {
                            failure += "<tr><td>" + userName + "</td><td>" + mobileno + "</td><td>Mobile No. is invalid. Please update the correct mobile no. in employee master</td></tr>";
                        }
                    }
                    else
                    {
                        failure += "<tr><td>" + userName + "</td><td>&nbsp</td><td>Mobile No. is empty. Please update the mobile no. in employee master</td></tr>";
                    }
                }
                if (failure != string.Empty)
                {
                    sbTableContent.Append("<table id='error' class='table table-striped' >");
                    sbTableContent.Append("<thead class='active'>");
                    sbTableContent.Append("<tr style='background-color: #428bca'>");
                    sbTableContent.Append("<td class='errortable'>User Name</td>");
                    sbTableContent.Append("<td class='errortable'>Mobile Number</td>");
                    sbTableContent.Append("<td class='errortable'>Error</td>");
                    sbTableContent.Append("</tr>");
                    sbTableContent.Append("</thead>");
                    sbTableContent.Append(failure);
                    sbTableContent.Append("</table>");

                    mesgalert = "SMS sent for " + successcount + " user(s). Failed to send SMS for " + failurecount + "user(s)";
                }
                else
                {
                    mesgalert = "SMS sent for " + successcount.ToString() + " user(s)";
                }
                return(sbTableContent.ToString() + "*" + mesgalert);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:UserCode", userCode);
                dicContext.Add("Filter:CreatedDate", createdDate);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return("Sorry an error occured. Please try again later.");
            }
        }
Ejemplo n.º 6
0
 public int SaveFormName(string formName, string formCusName)
 {
     objFormControls = new BL_FormControls();
     objCurInfo      = new DataControl.CurrentInfo();
     return(objFormControls.SaveFormName(formName, objCurInfo.GetCompanyCode(), objCurInfo.GetUserCode(), Convert.ToInt32(objCurInfo.GetCompanyId()), formCusName));
 }