Example #1
0
 public DocumentController()
 {
     _premierBusiness = new PremierBusiness();
     _docBusiness = new DocumentBusiness();
     _signBusiness = new SignatureBusiness();
     db = new DataProvider();
 }
Example #2
0
 public void AddTemplateDefaut(int mISN = 0)
 {
     _logger.Info("---Start AddTemplateDefaut---");
     try
     {
         var parameters = new Hashtable();
         parameters.Add("@MemberISN", mISN);
         // var check = new DataProvider().ExecuteQuery("select Count(*) from Vw_DebtExt_Document where MemberISN=@LeadISN and docLastAction='2'", parameters);
         //if (ConvertObjectToInt(check) < 2)
         var check = _db.Vw_DebtExt_Document.Where(m => m.MemberISN == mISN && m.docLastAction == "2").Count();
         if (check >= 2) return;
         var templateId = ConfigurationManager.AppSettings["TeamplateISN_CreateLead"];
         var dsTemplateName = new DataProvider().ExecuteQuery("Select TemplateISN, tplName, tplFile From DebtTemplate Where TemplateISN in (" + templateId + ")");
         if (dsTemplateName.Rows.Count > 0)
         {
             foreach (DataRow row in dsTemplateName.Rows)
             {
                 var tempISN = row["TemplateISN"].ToString();
                 var templateName = row["tplName"].ToString();
                 var fileName = row["tplFile"].ToString();
                 var docISN = DocumentEdit(0, mISN, fileName, null, "1", null, null, templateName, 2, -mISN);
                 if (docISN > 0)
                 {
                     var folder = GetTemplatePath(Convert.ToInt32(tempISN), null);
                     folder = Path.Combine(ConfigurationManager.AppSettings["UploadFolder"], folder);
                     var pathFull = Path.Combine(folder, fileName);
                     if (System.IO.File.Exists(pathFull))
                     {
                         var pathSave = Path.Combine(ConfigurationManager.AppSettings["UploadFolder"], this.GetDocumentsPath(docISN, null));
                         if (!Directory.Exists(pathSave)) Directory.CreateDirectory(pathSave);
                         System.IO.File.Copy(pathFull, Path.Combine(pathSave, fileName));
                     }
                 }
             }
         }
         _logger.Info("---End AddTemplateDefaut---");
     }
     catch (Exception ex)
     {
         _logger.Error(ex, ex.Message);
     }
 }
Example #3
0
 public ProfileController()
 {
     _data = new DataProvider("tbone", "tbone");
 }
Example #4
0
 DateTime GetLastRequest(int MemberISN)
 {
     string query = "select cvsDate from[Conversation] where ConversationISN in (select val_number from MemberExt3 where AttributeISN = 564 and MemberISN = @MemberISN)";
     var dataProvider = new DataProvider();
     var parameters = new Hashtable();
     parameters.Add("MemberISN", MemberISN);
     var tb = dataProvider.ExecuteQuery(query, parameters);
     if(tb.Rows.Count > 0)
     {
         return Convert.ToDateTime(tb.Rows[0][0]);
     }
     return new DateTime();
 }
Example #5
0
        public void GetMyProfile(int MemberISN)
        {
            var db = new PremierEntities();
            //var userInfos = db.xp_debtuser_getinfo(MemberISN);
            //var userInfo = userInfos.FirstOrDefault();

            var query = "xp_debtuser_getinfo";
            var parameters = new Hashtable();
            parameters.Add("MemberISN", MemberISN);

            var dataProvider = new DataProvider();
            var rsInt = 0;
            var ds = dataProvider.ExecuteStoreProcedure(query, parameters, out rsInt ) ;
            try
            {
                this.UserName = ds.Tables[0].Rows[0]["memUserName"].ToString();
                this.LastRequest = GetLastRequest(MemberISN);
                this.FirstName = ds.Tables[0].Rows[0]["memFirstName"].ToString();
                this.LastName = ds.Tables[0].Rows[0]["memLastName"].ToString();
                this.HomePhone = ds.Tables[0].Rows[0]["memHomePhone"].ToString();
                this.WorkPhone = ds.Tables[0].Rows[0]["memWorkPhone"].ToString();
                this.CellPhone = ds.Tables[0].Rows[0]["memPhone"].ToString();
                this.FaxNumber = ds.Tables[0].Rows[0]["memFax"].ToString();
                this.ClientID = ds.Tables[0].Rows[0]["memFax"].ToString();
                this.Email = ds.Tables[0].Rows[0]["memEmail"].ToString();
                this.DealerISN =  Convert.ToInt32(ds.Tables[0].Rows[0]["DealerISN"]);
                var attrRow = ds.Tables[1].Select("attID = 'BestTimeOfCall'");
                this.BestTimeToContact = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();

                attrRow = ds.Tables[1].Select("attID = 'MarriedStatus'");
                this._Married = attrRow.Length == 0 ? -1 : Convert.ToInt32(attrRow[0]["attValue"]);

                this.Address = ds.Tables[0].Rows[0]["memAddress"].ToString();
                this.City = ds.Tables[0].Rows[0]["memCity"].ToString();
                this._State = ds.Tables[0].Rows[0]["memState"].ToString();
                this.Zip = ds.Tables[0].Rows[0]["memZip"].ToString();

                attrRow = ds.Tables[1].Select("attID = 'Language'");
                this.Language = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();

                attrRow = ds.Tables[1].Select("attID = 'CoFirstName'");
                this.CoFirstName = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoLastName'");
                this.CoLastName = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoAddress'");
                this.CoAddress = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoCity'");
                this.CoCity = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoState'");
                this._CoState = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoZip'");
                this.CoZip = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'CoEmail'");
                this.CoEmail = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'IsCoClient'");
                this.IsCoClient = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString();
                attrRow = ds.Tables[1].Select("attID = 'ClientRequiredMFALogin'");
                this.IsMFARequired = attrRow.Length == 0 ? true : Convert.ToBoolean(attrRow[0]["attValue"]);
            }
            catch
                (Exception ex)
            {
                StatusGetData = ex.ToString();
            }
        }
Example #6
0
 public SignatureBusiness()
 {
     _data = new DataProvider();
 }