Пример #1
0
 public string fnGetLockRelease(string userCode)
 {
     try
     {
         DataSet dsEmail     = new DataSet();
         string  strmail     = "";
         string  strEmailid  = "";
         string  companyCode = _objCurInfo.GetCompanyCode();
         string  userName    = _objCurInfo.GetUserName();
         BLUser  objBLuser   = new BLUser();
         bool    lockrelease = objBLuser.GetLockRelease(companyCode, userCode, userName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "MANUAL");
         if (lockrelease)
         {
             dsEmail = objBLuser.checkEmailid(Session["Comp_Code"].ToString(), userCode);
         }
         if (dsEmail.Tables[0].Rows.Count > 0)
         {
             string strUserName = dsEmail.Tables[0].Rows[0]["User_Name"].ToString();
             string strPassword = dsEmail.Tables[0].Rows[0]["User_Pass"].ToString();
             strEmailid = dsEmail.Tables[0].Rows[0]["Email_Id"].ToString();
             strmail    = SendMail(strPassword, strUserName, strEmailid);
         }
         return(strmail + "*" + strEmailid);
     }
     catch (Exception ex)
     {
         Dictionary <string, string> dicContext = new Dictionary <string, string>();
         dicContext.Add("Filter:UserName", userCode);
         DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
         throw new Exception("Sorry an error occurred. Please try again later");
     }
 }