public JObject AddWebContactList(string sConnString, int userID, string listName, int mode) { JObject responseJObj = new JObject(); int returnValue = 0; string returnMessage = ""; int listID = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); returnValue = contactsObj.AddWebContactList(userID, listName, mode, out returnMessage, out listID); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("Message", returnMessage), new JProperty("ErrorCode", "117"), new JProperty("Status", returnValue.ToString()), new JProperty("listIdOut", listID.ToString())); } } catch (Exception ex) { Logger.ExceptionLog("Exception in AddWebContactList Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("AddWebListContacts", "WebListContact failed to Add"), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject DeleteListIdNListIdContacts(string sConnString, int userID, int listId, int mode) { JObject responseJObj = new JObject(); int returnValue = 0; string returnMessage = ""; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); returnValue = contactsObj.DeleteListIdNListIdContacts(userID, listId, mode, out returnMessage); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("Message", returnMessage), new JProperty("ErrorCode", "117"), new JProperty("Status", returnValue), new JProperty("listId", listId)); } } catch (Exception ex) { Logger.ExceptionLog("exception in DeleteListIdNListIdContacts Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject AddAllContactsToParticularList(string sConnString, int userId, string contactId, int mode, int listId) { JObject responseJObj = new JObject(); int returnValue = 0, listContactsCount = 0; string returnMessage = ""; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); returnValue = contactsObj.AddAllContactsToParticularList(userId, listId, contactId, mode, out returnMessage, out listContactsCount); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("Message", returnMessage), new JProperty("ErrorCode", "117"), new JProperty("ListContactsCount", listContactsCount), new JProperty("Status", returnValue), new JProperty("listId", listId)); } } catch (Exception ex) { Logger.ExceptionLog("Exception in AddAllContactsToParticularList Bll" + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject GetAllContactsLists(string sConnString, int userID) { JObject listsResponse = new JObject(); DataSet listsDataSet = new DataSet(); JObject listsJobj = new JObject(); JArray listsJarr = new JArray(); JArray deletedListsJarr = new JArray(); string retMessage = ""; string timeStamp = ""; int retVal = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); listsDataSet = contactsObj.GetAllContactsList(userID, out retVal, out retMessage, out timeStamp); if (retVal == 1) { if (listsDataSet.Tables[0].Rows.Count > 0) { foreach (DataRow _row in listsDataSet.Tables[0].Rows) { listsJobj = new JObject(); foreach (DataColumn _column in listsDataSet.Tables[0].Columns) { listsJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } listsJarr.Add(listsJobj); } } if (listsDataSet.Tables[1].Rows.Count > 0) { foreach (DataRow _row in listsDataSet.Tables[1].Rows) { foreach (DataColumn _column in listsDataSet.Tables[1].Columns) { deletedListsJarr.Add(_row["Id"]); } } } listsResponse = new JObject(new JProperty("Success", true), new JProperty("Message", "Success"), new JProperty("ErrorCode", "117"), new JProperty("TimeStamp", timeStamp), new JProperty("Lists", listsJarr), new JProperty("DeletedLists", deletedListsJarr)); } else { listsResponse = new JObject(new JProperty("Success", false), new JProperty("ErrorCode", "112"), new JProperty("Message", retMessage)); } } catch (Exception ex) { listsResponse = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); Logger.TraceLog("Exception In GetAllContactsLists BLL : " + ex.ToString()); } return(listsResponse); }
public JObject DeleteWebContact(string sConnString, int userID, int contactID, int listId, int mode) { JObject responseJObj = new JObject(); DataSet ds = new DataSet(); JObject tempJobj = new JObject(); JArray Jarr = new JArray(); int returnValue = 0; string returnMessage = ""; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); ds = contactsObj.DeleteWebContact(userID, listId, contactID, mode, out returnValue, out returnMessage); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("Status", returnValue), new JProperty("ErrorCode", "117"), new JProperty("Message", returnMessage)); } else { responseJObj = new JObject(new JProperty("Success", false), new JProperty("Status", returnValue), new JProperty("ErrorCode", "101"), new JProperty("Message", "Contact deleted")); } } catch (Exception ex) { Logger.ExceptionLog("exception in DeleteWebContact Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject PhoneCallHistorySync(string sConnString, int userID, string phoneNumbers) { JObject listsResponse = new JObject(); JObject listsJobj = new JObject(); string retMessage = ""; string timeStamp = ""; int retVal = 0, errorCode = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); retVal = contactsObj.PhoneCallHistorySync(userID, phoneNumbers, out retMessage, out errorCode); if (retVal == 1) { listsResponse = new JObject(new JProperty("Success", true), new JProperty("Message", "Success"), new JProperty("ErrorCode", errorCode)); } else { listsResponse = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); } } catch (Exception ex) { listsResponse = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); Logger.TraceLog("Exception In PhoneCallHistorySync BLL : " + ex.ToString()); } return(listsResponse); }
public JObject UploadExcelData(string sConnString, int userID, DataTable dt, int listId) { JObject responseJObj = new JObject(); JArray jar = new JArray(); int returnValue = 0; DataSet ds = new DataSet(); string returnMessage = ""; try { foreach (DataRow dr in dt.Rows) { foreach (DataColumn dc in dt.Columns) { Logger.TraceLog(dc.ColumnName + "---" + dr[dc.ColumnName]); } } DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); ds = contactsObj.UploadExcelData(userID, dt, out returnValue, out returnMessage, listId); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("Status", returnValue), new JProperty("ErrorCode", "117"), new JProperty("Message", returnMessage)); } else { responseJObj = new JObject(new JProperty("Success", false), new JProperty("Status", returnValue), new JProperty("ErrorCode", "101"), new JProperty("Message", returnMessage)); } } catch (Exception ex) { Logger.ExceptionLog("exception in UploadExcelData Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject ManageWebContacts(string sConnString, int userId, string name, string mobileNumber, string prefix, int contactID, int mode, int listID, string tempCropImagePath) { JObject responseJObj = new JObject(); JArray jar = new JArray(); MemoryStream mStream = new MemoryStream(); int returnValue = 0; string returnMessage = ""; string imagePath = ""; int contactId = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); imagePath = HttpContext.Current.Server.MapPath("/ContactImages/"); //byte[] imgCropArray = ReadFile(imagePath + tempCropImagePath); DataSet ds = contactsObj.ManageWebContacts(userId, name, mobileNumber, prefix, contactID, mode, listID, out returnValue, out returnMessage, tempCropImagePath, out contactId); if (returnValue == 1) { responseJObj = new JObject(new JProperty("Success", true), new JProperty("ContactId", contactId), new JProperty("Status", returnValue), new JProperty("ErrorCode", "117"), new JProperty("Message", returnMessage)); } else { responseJObj = new JObject(new JProperty("Success", false), new JProperty("Status", returnValue), new JProperty("ErrorCode", "142"), new JProperty("Message", "Contact Not created")); } } catch (Exception ex) { Logger.ExceptionLog("Exception in ManageWebContacts Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("Message", "Something Went Wrong"), new JProperty("ErrorCode", "101")); } return(responseJObj); }
public JObject WebContactsList(string sConnString, int userID, int mode, int listId, int source, int pageIndex, string alphabetSort, string searchValue) { JObject responseJObj = new JObject(); DataSet ds = new DataSet(); JObject contactJobj = new JObject(); JObject listJobj = new JObject(); JObject contactListJobj = new JObject(); JArray Jarr = new JArray(); JArray JarrList = new JArray(); JArray JarrContactList = new JArray(); int returnValue = 0; string returnMessage = ""; int pageCount = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); ds = contactsObj.WebContactsList(userID, mode, listId, source, pageIndex, alphabetSort, searchValue, out returnValue, out returnMessage, out pageCount); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow _row in ds.Tables[0].Rows) { contactJobj = new JObject(); foreach (DataColumn _column in ds.Tables[0].Columns) { contactJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } Jarr.Add(contactJobj); } } if (mode == 1) { if (ds.Tables[1].Rows.Count > 0) { foreach (DataRow _row in ds.Tables[1].Rows) { listJobj = new JObject(); foreach (DataColumn _column in ds.Tables[1].Columns) { listJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } JarrList.Add(listJobj); } } //if (Ds.Tables[3].Rows.Count > 0) //{ // foreach (DataRow _row in Ds.Tables[3].Rows) // { // contactListJobj = new JObject(); // foreach (DataColumn _column in Ds.Tables[3].Columns) // { // contactListJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); // } // JarrContactList.Add(contactListJobj); // } //} } responseJObj = new JObject(new JProperty("Success", true), new JProperty("Message", returnMessage), new JProperty("Status", returnValue), new JProperty("contactsData", Jarr), new JProperty("contactListDetails", JarrList), new JProperty("contactListData", JarrContactList)); } catch (Exception ex) { Logger.ExceptionLog("exception in WebContactsList Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("success", false), new JProperty("message", "No contatcs found")); } return(responseJObj); }
public JObject GetMobilContactsDetailsSort(string sConnString, int userId, int source, string alphabet, int mode, int pageIndex, int listId, HttpContext context) { JObject jResponse = new JObject(); JArray jArray = new JArray(); JArray jarSubcontcts = new JArray(); try { int retValue = 0, contactsCount = 0; string retMessage = ""; int pageCount = 1; DataSet allContacts = new DataSet(); DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); allContacts = contactsObj.GetMobileContactDetailsSort(userId, source, mode, alphabet, pageIndex, listId, out retValue, out retMessage, out pageCount, out contactsCount); if (retValue == 1) { if (allContacts != null) { if (allContacts.Tables.Count != 0) { if (allContacts.Tables[0].Rows.Count != 0) { for (int rowCount = 0; rowCount < allContacts.Tables[0].Rows.Count; rowCount++) { if (source == 1) { DataRow[] result = null; if (allContacts.Tables.Count > 1) { result = null; if (allContacts.Tables[1].Rows.Count != 0) { result = allContacts.Tables[1].Select("ContactID =" + allContacts.Tables[0].Rows[rowCount]["ID"] + " "); int COUNT = result.Count(); jarSubcontcts = new JArray(); foreach (DataRow drSubContacts in result) { jarSubcontcts.Add(new JObject(new JProperty("subContactId", drSubContacts["contactId"]), new JProperty("contactType", drSubContacts["contactType"]), new JProperty("contactNumber", drSubContacts["Number"]), new JProperty("userId", drSubContacts["UserId"]))); } } } } jArray.Add(new JObject(new JProperty("id", allContacts.Tables[0].Rows[rowCount]["Id"]), new JProperty("name", allContacts.Tables[0].Rows[rowCount]["Name"]), new JProperty("mobileNumber", allContacts.Tables[0].Rows[rowCount]["MobileNumber"]), new JProperty("imagePath", allContacts.Tables[0].Rows[rowCount]["ImagePath"]), new JProperty("source", allContacts.Tables[0].Rows[rowCount]["Source"]), new JProperty("Prefix", allContacts.Tables[0].Rows[rowCount]["Prefix"]), new JProperty("subContactDeatils", jarSubcontcts))); } jResponse = new JObject(new JProperty("Success", true), new JProperty("Message", retMessage), new JProperty("Status", retValue), new JProperty("ErrorCode", "117"), new JProperty("ContactsCount", contactsCount), new JProperty("pageCount", pageCount), new JProperty("contactDetails", jArray)); return(jResponse); } else { jResponse = new JObject(new JProperty("Success", false), new JProperty("Message", "No Data Found"), new JProperty("ErrorCode", "139"), new JProperty("ContactsCount", contactsCount), new JProperty("Status", 0)); return(jResponse); } } } } else { jResponse = new JObject(new JProperty("Success", false), new JProperty("Message", retMessage), new JProperty("ErrorCode", "101")); return(jResponse); } } catch (Exception ex) { jResponse = new JObject(new JProperty("Success", false), new JProperty("Message", ex.ToString()), new JProperty("ErrorCode", "101")); //new JProperty("Message", ex.StackTrace)); Logger.ExceptionLog("Exception in GetMobilContactsDetailsSort BLL" + ex.StackTrace); } return(jResponse); }
public JObject WebContactsList(string sConnString, int userID, int listId, int pageIndex) { JObject responseJObj = new JObject(); DataSet ds = new DataSet(); JObject contactJobj = new JObject(); JObject listJobj = new JObject(); JObject contactListJobj = new JObject(); JArray Jarr = new JArray(); JArray JarrList = new JArray(); JArray JarrContactList = new JArray(); int returnValue = 0; string returnMessage = ""; int pageCount = 0, allContactsCount = 0; try { DataAccessLayer.V_1_3.Contacts_V130 contactsObj = new DataAccessLayer.V_1_3.Contacts_V130(sConnString); ds = contactsObj.WebContactsList(userID, listId, pageIndex, out returnValue, out returnMessage, out pageCount, out allContactsCount); if (returnValue == 1) { if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow _row in ds.Tables[0].Rows) { contactJobj = new JObject(); foreach (DataColumn _column in ds.Tables[0].Columns) { contactJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } Jarr.Add(contactJobj); } } if (ds.Tables[1].Rows.Count > 0) { foreach (DataRow _row in ds.Tables[1].Rows) { listJobj = new JObject(); foreach (DataColumn _column in ds.Tables[1].Columns) { listJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } JarrList.Add(listJobj); } } if (ds.Tables[3].Rows.Count > 0) { foreach (DataRow _row in ds.Tables[3].Rows) { contactListJobj = new JObject(); foreach (DataColumn _column in ds.Tables[3].Columns) { contactListJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName])); } JarrContactList.Add(contactListJobj); } } responseJObj = new JObject(new JProperty("Success", true), new JProperty("Message", returnMessage), new JProperty("ErrorCode", "117"), new JProperty("Status", returnValue), new JProperty("AllContactsCount", allContactsCount), new JProperty("pageCount", pageCount), new JProperty("Items", Jarr), new JProperty("ContactList", JarrList), new JProperty("Data", JarrContactList)); } } catch (Exception ex) { Logger.ExceptionLog("exception in WebContactsList Bll " + ex.ToString()); responseJObj = new JObject(new JProperty("Success", false), new JProperty("Message", "No contatcs found"), new JProperty("ErrorCode", "101")); } return(responseJObj); }