private void btnUpdate_Click(object sender, EventArgs e) { using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var service = new ServiceManager.Service(); service.Method = "Update"; service.ServiceName = txtbServiceName.Text; service.serviceDescription = txtbServiceDescription.Text; service.IdService = Convert.ToInt32(FormViewingServices.Id); serviceService.MangeServices(service); MessageUtils.LogUtils.WriteToLog(" Update Service: " + txtbServiceName.Text + "Description: " + this.ServiceDescription); MessageUtils.LogUtils.SystemEventLogsInformation(" Update Service: " + txtbServiceName.Text + "Description: " + this.ServiceDescription); new MessageUtils.MessageBoxText(string.Format(" שרות עודכן בהצלחה: {0}", txtbServiceName.Text)).OkMessaageBox(); this.DialogResult = DialogResult.OK; this.Close(); } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(" Update Service Faild dosn't Exist!!!!: " + txtbServiceName.Text + " Exception: " + ex.Message); MessageUtils.LogUtils.SystemEventLogsError("Update Service Faild dosn't Exist!!!!: " + txtbServiceName.Text + " Exception: " + ex.Message); new MessageUtils.MessageBoxText(string.Format(" Update Service Faild dosn't Exist!!!!: {0}", txtbServiceName.Text)).ErrorMessageBox(); this.DialogResult = DialogResult.OK; this.Close(); } } }
public void deleteRowToolStripMenuItem(DataGridViewRow dr) { Id = dr.Cells["idCompany_Company"].Value.ToString(); string companynumber = dr.Cells["companynumber"].Value.ToString(); using (var myClient = new ServiceManager.ServiceSystemCompaniesClient()) { try { var comp = new ServiceManager.Companies(); comp.Method = "CheckCompanyNumber"; comp.companynumber = companynumber; comp = myClient.ManageCompanies(comp); if (!comp.isBool) { comp.idCompany = Convert.ToInt32(Id); comp.Method = "Delete"; myClient.ManageCompanies(comp); LogUtils.WriteToLog(" Delete Row Viewing All Customers: " + dr.Cells["companyName"].Value.ToString()); LogUtils.SystemEventLogsInformation(" Delete Row Viewing All Customers: " + dr.Cells["companyName"].Value.ToString()); } else { LogUtils.WriteToLog(" The customer does not exist failed to delete: " + dr.Cells["companyName"].Value.ToString()); LogUtils.SystemEventLogsWarning(" The customer does not exist failed to delete: " + dr.Cells["companyName"].Value.ToString()); } } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Failed delete Customer: {0} Exception: {1} ", dr.Cells["companyName"].Value.ToString(), ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Failed delete Customer: {0} Exception: {1} ", dr.Cells["companyName"].Value.ToString(), ex.Message)); } } }
public DataTable InitializeProject() { using (var ds = new DataSet()) { using (var myClient = new ServiceManager.ServiceSystemCompaniesClient()) { try { var project = new ServiceManager.Project(); // project.Method = "GetAllProjects"; project.Method = "GetAllProjectsDataSet"; project = myClient.ManageProject(project); // string stringValue = project.DataProject; // StringReader reader = new StringReader(stringValue); // ds.ReadXml(reader); // return ds.Tables["Project"]; return(project.DataProjectDataSet.Tables[0]); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Error Viewing Project. Exception: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Error Viewing Project. Exception: {0} ", ex.Message)); return(null); } } } }
public DataTable InitializeServiceCallsDatagrid() { using (var ds = new DataSet()) { using (var myServiceCalls = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCall = new ServiceManager.ServiceCalls(); //serviceCall.Method = "GetAllServiceCalls"; serviceCall.Method = "GetAllServiceCallsDataSet"; serviceCall = myServiceCalls.ManageServiceCalls(serviceCall); //StringReader reader = new StringReader(serviceCall.DataServiceCalls); //ds.ReadXml(reader); //return ds.Tables["ServiceCall"]; return(serviceCall.DataServiceCallsDataSet.Tables[0]); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Get All Service Calls faild. Exception: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Get All Service Calls faild. Exception: {0} ", ex.Message)); return(null); } } } }
private void btnUpdate_Click(object sender, EventArgs e) { using (var myClient = new ServiceManager.ServiceSystemCompaniesClient()) { try { var project = new ServiceManager.Project(); project.Method = "Update"; project.projectName = txtbProjectName.Text; project.projectDescription = txtProjectDiscriptions.Text; project.idProject = this.IdProject; myClient.ManageProject(project); LogUtils.WriteToLog(" Update Project: " + txtbProjectName.Text); LogUtils.SystemEventLogsInformation(" Update Project: " + txtbProjectName.Text); new MessageBoxText(string.Format(" פרויקט עודכן בהצלחה: {0}", txtbProjectName.Text)).OkMessaageBox(); this.DialogResult = DialogResult.OK; } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Faild Update Project: {0}. Exception: {1} ", txtbProjectName.Text, ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Faild Update Project: {0}. Exception: {1} ", txtbProjectName.Text, ex.Message)); } } this.Close(); }
public void DeleteRoWServiceCall(DataGridViewRow dr) { IdCallsServices = dr.Cells["idCallsServices"].Value.ToString(); using (var myServiceCalls = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCall = new ServiceManager.ServiceCalls(); serviceCall.Method = "CheckServiceCall"; serviceCall.idServiceCall = Convert.ToInt32(IdCallsServices); serviceCall = myServiceCalls.ManageServiceCalls(serviceCall); if (!serviceCall.isBool) { serviceCall.Method = "Delete"; myServiceCalls.ManageServiceCalls(serviceCall); LogUtils.WriteToLog(" Delete Service Calls: " + dr.Cells["companyName_Service_Call"].Value.ToString()); LogUtils.SystemEventLogsInformation(" Delete Service Calls: " + dr.Cells["companyName_Service_Call"].Value.ToString()); } else { LogUtils.WriteToLog(" Delete faild Service Calls dosn't exist: " + dr.Cells["companyName_Service_Call"].Value.ToString()); LogUtils.SystemEventLogsWarning(" Delete faild Service Calls dosn't exist: " + dr.Cells["companyName_Service_Call"].Value.ToString()); } } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Delete faild Service Calls: {0}. Exception: {1}", dr.Cells["companyName_Service_Call"].Value.ToString(), ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Delete faild Service Calls: {0}. Exception: {1}", dr.Cells["companyName_Service_Call"].Value.ToString(), ex.Message)); } } }
public void InitcombListCompany() { if (IsForSpecificCompany) { combListCompany.Items.Clear(); IDToName comp = new IDToName(this._companyName, this.CompanyId); combListCompany.Items.Add(comp); } else { using (var companyService = new ServiceManager.ServiceSystemCompaniesClient()) { var comp = new ServiceManager.Companies(); comp.Method = "GetAllCustomersToDropDown"; comp = companyService.ManageCompanies(comp); foreach (var listComp in comp.list) //foreach (var listComp in CompanyServices.Instance.GetAllCustomersToDropDown()) { string companyName = listComp.Item1; string idCompany = listComp.Item2.ToString(); IDToName company = new IDToName(companyName, idCompany); combListCompany.Items.Add(company); } } } if (combListCompany.Items.Count > 0) { combListCompany.SelectedIndex = 0; } }
public DataTable InitServicedatagrid() { using (var ds = new DataSet()) { using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var service = new ServiceManager.Service(); // service.Method = "GetAllService"; service.Method = "GetAllServiceDataSet"; service = serviceService.MangeServices(service); // StringReader reader = new StringReader(service.ServiceData); //ds.ReadXml(reader); // return ds.Tables["Service"]; return(service.ServiceDataSet.Tables[0]); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Error Viewing All Services. Exception: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Error Viewing All Services. Exception: {0} ", ex.Message)); return(null); } } } }
private void InitializeListPriority() { using (var ds = new DataSet()) { using (var priorityService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var priority = new ServiceManager.Priority(); //priority.Method = "GetAllPriorities"; priority.Method = "GetAllPrioritiesDataSet"; priority = priorityService.ManagePriority(priority); //StringReader reader = new StringReader(priority.PriorityData); //ds.ReadXml(reader); //dgridvListPriority.DataSource = ds.Tables["Priority"]; dgridvListPriority.DataSource = priority.PriorityDataSet.Tables[0]; } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Faild Viewing Priority: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Faild Viewing Priority: {0} ", ex.Message)); } } } }
private static bool CheckConnection() { try { using (var userService = new ServiceManager.ServiceSystemCompaniesClient()) { userService.Open(); var user = new ServiceManager.Users(); user.Method = "CheckConnection"; user = userService.ManageUsers(user); if (user.isBool) { return(true); } MessageUtils.LogUtils.SystemEventLogsInformation(ERRORMESSAGE); MessageUtils.LogUtils.WriteToLog(ERRORMESSAGE); ErrorMessageBox(ERRORMESSAGE); return(false); } } catch { return(false); } }
public void InitcombListProject() { if (IsForSpecificCompany) { combListProject.Items.Clear(); IDToName project = new IDToName(this._projectName, this.IdProject); combListProject.Items.Add(project); } else { using (var projectService = new ServiceManager.ServiceSystemCompaniesClient()) { var project = new ServiceManager.Project(); project.Method = "GetAllProjectsToDropDown"; project = projectService.ManageProject(project); foreach (var listProject in project.list) { string projectName = listProject.Item1; string idProject = listProject.Item2.ToString(); IDToName service = new IDToName(projectName, idProject); combListProject.Items.Add(service); } } } if (combListProject.Items.Count > 0) { combListProject.SelectedIndex = 0; } }
private void InitializeListUser() { string userName = string.Empty; string idUser = string.Empty; using (var userService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var user = new ServiceManager.Users(); user.Method = "fillDropDown"; user = userService.ManageUsers(user); foreach (var listUsers in user.list) { idUser = listUsers.Item2.ToString(); userName = listUsers.Item1; if (userName != "admin") { IDToName users = new IDToName(userName, idUser); comboxListUsers.Items.Add(users); } } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error Get All User. Exception: {0} ", ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Get All User. Exception: {0} ", ex.Message)); } if (comboxListUsers.Items.Count > 0) { comboxListUsers.SelectedIndex = 0; } } }
public string GetPermission() { if (this.UserName == "administrator" && this.Password == "12213443") { return("True"); } using (var userService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var user = new ServiceManager.Users(); user.UserName = this.UserName; user.Password = this.Password; user.Method = "getPermission"; user = userService.ManageUsers(user); return(user.Permission); } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error get Permission. Exception: {0}.", ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error get Permission. Exception: {0}.", ex.Message)); return(null); } } }
private void btnAddCallsServices1_Click(object sender, EventArgs e) { using (var myServiceCalls = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCall = new ServiceManager.ServiceCalls(); serviceCall.Method = "Insert"; serviceCall.dateOpenCalls = DateOpenCalls; serviceCall.discriptions = Discription; serviceCall.status = status; serviceCall.idCompany = Convert.ToInt32(IdCompany); serviceCall.idPriority = Convert.ToInt32(IdPriority); myServiceCalls.ManageServiceCalls(serviceCall); LogUtils.WriteToLog(" Add Calls Services"); LogUtils.SystemEventLogsInformation(" Add Calls Services"); new MessageBoxText("נוסף בהצלחה").OkMessaageBox(); this.DialogResult = DialogResult.OK; } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Error Add Calls Services: {0}. Exception: {1}", Discription, ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Error Add Calls Services: {0}. Exception: {1}", Discription, ex.Message)); new MessageBoxText("Error Add Calls Services").ErrorMessageBox(); } this.Close(); } }
public DataTable GetAllCustomers() { using (var ds = new DataSet()) { using (var myClient = new ServiceManager.ServiceSystemCompaniesClient()) { try { var comp = new ServiceManager.Companies(); // comp.Method = "GetCompanies"; //comp = myClient.ManageCompanies(comp); // comp.Method = "GetCompaniesDataTable"; comp.Method = "GetCompaniesDataSet"; comp = myClient.ManageCompanies(comp); // string stringValue = comp.stringData; // StringReader reader = new StringReader(stringValue); // ds.ReadXml(reader); //return ds.Tables["Companies"]; //return comp.EmployeeTable; return(comp.EmployeeDataSet.Tables[0]); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Failed Get Companies. Exception: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Failed Get Companies. Exception: {0} ", ex.Message)); return(null); } } } }
public DataTable DayView(double daysToShow) { using (var ds = new DataSet()) { using (var myServiceCalls = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCall = new ServiceManager.ServiceCalls(); serviceCall.daysToShow = daysToShow; //serviceCall.Method = "GetServiceCallsBetweenDate"; serviceCall.Method = "GetServiceCallsBetweenDateDataSet"; serviceCall = myServiceCalls.ManageServiceCalls(serviceCall); //StringReader reader = new StringReader(serviceCall.DataServiceCallsBetweenDate); //ds.ReadXml(reader); //return ds.Tables["ServiceCallsBetweenDate"]; return(serviceCall.DataServiceCallsBetweenDateDataSet.Tables[0]); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Get Service Calls Between Date faild. Exception: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Get Service Calls Between Date faild. Exception: {0} ", ex.Message)); return(null); } } } }
private void btnupdate_Click(object sender, EventArgs e) { using (var myComp = new ServiceManager.ServiceSystemCompaniesClient()) { try { var comp = new ServiceManager.Companies(); comp.Method = "CheckCompanyNumber"; comp.companynumber = this.CompanyNumber; comp = myComp.ManageCompanies(comp); if (!comp.isBool) { comp.companyName = CompanyName; comp.contactName = PrivateName; comp.mobilePhone = Mobile; comp.email = Email; comp.Phone = Phone; comp.FAX = Fax; comp.companynumber = CompanyNumber; comp.address = Address; comp.city = City; comp.ZIP = ZipNum; comp.PostalNum = PostalNum; comp.paymentTerms = PaymentTerms; comp.idCompany = Convert.ToInt32(FromManageViewingAllCustomers.Id); comp.Method = "Update"; myComp.ManageCompanies(comp); MessageUtils.LogUtils.WriteToLog(" Update the Customer: " + CompanyName); MessageUtils.LogUtils.SystemEventLogsInformation(" Update the Customer: " + CompanyName); new MessageUtils.MessageBoxText(string.Format(" לקוח עודכן בהצלחה: {0}", CompanyName)).OkMessaageBox(); this.DialogResult = DialogResult.OK; } else { MessageUtils.LogUtils.WriteToLog(" Customer does not exist: " + CompanyName); MessageUtils.LogUtils.SystemEventLogsWarning(" Customer does not exist: " + CompanyName); new MessageUtils.MessageBoxText(string.Format(" Customer does not exist: {0}", CompanyName)).OkMessaageBox(); this.DialogResult = DialogResult.OK; } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error Update Customer: {0} Exception: {1}", CompanyName, ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Update Customer: {0} Exception: {1}", CompanyName, ex.Message)); } } this.Close(); }
private void btnAdd_Click(object sender, EventArgs e) { using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient()) { var service = new ServiceManager.Service(); service.Method = "Insert"; service.ServiceName = txtbServiceName.Text; service.serviceDescription = txtbServiceDescription.Text; serviceService.MangeServices(service); } MessageUtils.LogUtils.WriteToLog(" Add Service: " + txtbServiceName.Text); MessageUtils.LogUtils.SystemEventLogsInformation(" Add Service:" + txtbServiceName.Text); new MessageUtils.MessageBoxText(string.Format(" שרות נוסף בהצלחה: {0}", txtbServiceName.Text)).OkMessaageBox(); this.DialogResult = DialogResult.OK; this.Close(); }
public void deleteRowToolStripMenuItem(DataGridViewRow dr) { using (var objServiceToCompany = new ServiceManager.ServiceSystemCompaniesClient()) { var serviceCompany = new ServiceManager.ServiceToCompany(); serviceCompany.Method = "CheckToAdd"; serviceCompany.idCompany = Convert.ToInt16(dr.Cells["IdCompany_Services"].Value.ToString()); serviceCompany.idService = Convert.ToInt16(dr.Cells["idservice_Services_Company"].Value.ToString()); serviceCompany = objServiceToCompany.ManageServiceToCompany(serviceCompany); if (!serviceCompany.isBool) { serviceCompany.Method = "Delete"; objServiceToCompany.ManageServiceToCompany(serviceCompany); } } }
private void btnAdd_Click(object sender, EventArgs e) { using (var objServiceToCompany = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCompany = new ServiceManager.ServiceToCompany(); serviceCompany.idService = Convert.ToInt16(ServiceId); serviceCompany.idCompany = Convert.ToInt16(CompanyId); serviceCompany.Method = "CheckToAdd"; serviceCompany = objServiceToCompany.ManageServiceToCompany(serviceCompany); if (serviceCompany.isBool) { if (PriceCost == string.Empty) { PriceCost = "0"; } serviceCompany.Startdate = Startdate; serviceCompany.Enddate = Enddate; serviceCompany.Paid = Paid; serviceCompany.Price = Price; serviceCompany.priceCost = PriceCost; serviceCompany.idCompany = Convert.ToInt16(CompanyId); serviceCompany.idService = Convert.ToInt16(ServiceId); serviceCompany.Method = "Insert"; objServiceToCompany.ManageServiceToCompany(serviceCompany); MessageUtils.LogUtils.WriteToLog(String.Format(" Manage Customer To Services: {0} And {1}", CompanyName, ServiceName)); MessageUtils.LogUtils.SystemEventLogsInformation(String.Format(" Manage Customer To Services: {0} And {1}", CompanyName, ServiceName)); new MessageUtils.MessageBoxText("נוסף בהצלחה").OkMessaageBox(); this.DialogResult = DialogResult.OK; } else { MessageUtils.LogUtils.WriteToLog(String.Format(" Error Manage Customer To Services the company and service exist: {0} And {1}", CompanyName, ServiceName)); MessageUtils.LogUtils.SystemEventLogsWarning(String.Format(" Error Manage Customer To Services the company and service exist: {0} And {1}", CompanyName, ServiceName)); new MessageUtils.MessageBoxText("קיים במערכת אותו שרות ללקוח הנבחר").OkMessaageBox(); } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(String.Format(" Error Manage Customer {0} Services: {1} . Exception: {2}", CompanyName, ServiceName, ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(String.Format(" Error Manage Customer {0} Services: {1} . Exception: {2}", CompanyName, ServiceName, ex.Message)); } this.Close(); } }
private void btnAdd_Click(object sender, EventArgs e) { using (var myComp = new ServiceManager.ServiceSystemCompaniesClient()) { try { var comp = new ServiceManager.Companies(); comp.Method = "CheckCompanyNumber"; comp.companynumber = this.CompanyNumber; comp = myComp.ManageCompanies(comp); if (comp.isBool) { comp.companyName = CompanyName; comp.contactName = PrivateName; comp.mobilePhone = Mobile; comp.email = Email; comp.Phone = Phone; comp.FAX = Fax; comp.companynumber = CompanyNumber; comp.address = Address; comp.city = City; comp.ZIP = ZipNum; comp.PostalNum = PostalNum; comp.paymentTerms = PaymentTerms; comp.Method = "Insert"; myComp.ManageCompanies(comp); MessageUtils.LogUtils.WriteToLog(" Add Customer: " + CompanyName + " PostalNum: " + PostalNum); MessageUtils.LogUtils.SystemEventLogsInformation(" Add Customer: " + CompanyName + " PostalNum: " + PostalNum); new MessageUtils.MessageBoxText(string.Format(" לקוח נוסף בהצלחה: {0}", CompanyName)).OkMessaageBox(); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageUtils.LogUtils.WriteToLog(" Customer exist: " + CompanyName); MessageUtils.LogUtils.SystemEventLogsInformation(" Customer exist: " + CompanyName); new MessageUtils.MessageBoxText(string.Format(" לקוח קיים במערכת: {0}", CompanyName)).OkMessaageBox(); } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format("Error Insert Customer: {0} Exception: {1}", CompanyName, ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format("Error Insert Customer: {0} Exception: {1}", CompanyName, ex.Message)); } } }
public DataTable InitializeListServiceCompany() { using (var ds = new DataSet()) { using (var objServiceToCompany = new ServiceManager.ServiceSystemCompaniesClient()) { var serviceToCompany = new ServiceManager.ServiceToCompany(); // serviceToCompany.Method = "GetAll"; serviceToCompany.Method = "GetAllDataSet"; serviceToCompany = objServiceToCompany.ManageServiceToCompany(serviceToCompany); // StringReader reader = new StringReader(serviceToCompany.DataServiceToCompany); // ds.ReadXml(reader); return(serviceToCompany.ServiceToCompanyDataSet.Tables[0]); } // return ds.Tables["ServiceToCompany"]; } }
private void deleteRowToolStripMenuItem_Click(object sender, EventArgs e) { if (dgridvListPriority.SelectedRows.Count != 1) { return; } string message = "?בטוח שאתה רוצה למחוק"; string titel = "מחיקת עדיפות"; if (new MessageBoxText(message, titel).YesorNoMessageBox() == DialogResult.No) { return; } DataGridViewRow dr = dgridvListPriority.SelectedRows[0]; this.IdPriorityFromGrid = dr.Cells["idPriority"].Value.ToString(); using (var priorityService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var priority = new ServiceManager.Priority(); priority.Method = "CheckPriorityId"; priority.IdPriority = Convert.ToInt32(this.IdPriorityFromGrid); priority = priorityService.ManagePriority(priority); if (!priority.isBool) { priority.Method = "Delete"; priorityService.ManagePriority(priority); LogUtils.WriteToLog(" Delete Priority "); LogUtils.SystemEventLogsWarning(" Delete Priority"); } else { LogUtils.WriteToLog(" Priority doesn't exist Delete faild "); LogUtils.SystemEventLogsWarning(" Priority doesn't exist Delete faild"); } } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Faild Delete Priority: {0} ", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Faild Delete Priority: {0} ", ex.Message)); } } InitializeListPriority(); }
private void buttonAddUser_Click(object sender, EventArgs e) { if (radioButtonAdmin.Checked != false || radioButtonSec.Checked != false) { using (var userService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var user = new ServiceManager.Users(); user.Method = "CheckUser"; user.UserName = UserName; user = userService.ManageUsers(user); if (!user.isBool) { const string title = "שם משתמש קיים"; const string message = "קיימת כפילות של שם משתמש"; new MessageBoxText(message, title).ErrorMessageBox(); txtBoxUserName.BackColor = Color.Red; } else { user.Method = "Insert"; user.UserName = UserName; user.PrivateName = PrivateName; user.Permission = UserPermissionAdmin; user.Password = Password; userService.ManageUsers(user); new MessageUtils.MessageBoxText(string.Format(" משתמש {0} נוסף בהצלחה ", PrivateName)).OkMessaageBox(); } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error Insert User: {0} Exception: {1}", PrivateName, ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Insert User: {0} Exception: {1}", PrivateName, ex.Message)); } this.Close(); } } else { MessageBox.Show("נא לבחור סוג הרשאה", "סוג הרשאה לא נבחר", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnupdate_Click(object sender, EventArgs e) { using (var objServiceToCompany = new ServiceManager.ServiceSystemCompaniesClient()) { try { var serviceCompany = new ServiceManager.ServiceToCompany(); serviceCompany.Method = "CheckToAdd"; serviceCompany.idCompany = Convert.ToInt16(CompanyId); serviceCompany.idService = Convert.ToInt16(ServiceId); serviceCompany = objServiceToCompany.ManageServiceToCompany(serviceCompany); if (!serviceCompany.isBool) { serviceCompany.Method = "Update"; serviceCompany.Startdate = Startdate; serviceCompany.Enddate = Enddate; serviceCompany.Paid = Paid; serviceCompany.Price = Price; serviceCompany.priceCost = PriceCost; objServiceToCompany.ManageServiceToCompany(serviceCompany); MessageUtils.LogUtils.WriteToLog(" Update Manage Service To Customers"); MessageUtils.LogUtils.SystemEventLogsInformation(" Update Manage Service To Customers"); new MessageUtils.MessageBoxText("עודכן בהצלחה").OkMessaageBox(); this.DialogResult = DialogResult.OK; } else { MessageUtils.LogUtils.WriteToLog(" Service to Customers does not exist update failed"); MessageUtils.LogUtils.SystemEventLogsWarning(" Service to Customers does not exist update failed"); new MessageUtils.MessageBoxText("Service to Customers does not exist update failed").WarningMessageBox(); this.DialogResult = DialogResult.OK; } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error Update Service to Customers. Exception: {0}", ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Update Service to Customers. Exception: {0}", ex.Message)); new MessageUtils.MessageBoxText("Error Update Service to Customers").ErrorMessageBox(); } this.Close(); } }
public void DeleteProject(DataGridViewRow dr) { Id = dr.Cells["idProject"].Value.ToString(); using (var myClient = new ServiceManager.ServiceSystemCompaniesClient()) { try { var project = new ServiceManager.Project(); project.idProject = Convert.ToInt32(Id); project.Method = "Delete"; myClient.ManageProject(project); LogUtils.WriteToLog(" Delete Row Viewing All Project: " + dr.Cells["projectName"].Value.ToString()); LogUtils.SystemEventLogsInformation(" Delete Row Viewing All Project: " + dr.Cells["projectName"].Value.ToString()); } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Faild Delete Project: {0}. Exception: {1} ", dr.Cells["projectName"].Value.ToString(), ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Faild Delete Project: {0}. Exception: {1} ", dr.Cells["projectName"].Value.ToString(), ex.Message)); } } }
public void InitcombListCustomers() { if (IsForSpecificCustomer) { combListCust.Items.Clear(); IDToName comp = new IDToName(this._companyName, this.CompanyId); combListCust.Items.Add(comp); } else { string idComp = string.Empty; string Compname = string.Empty; using (var servicCompany = new ServiceManager.ServiceSystemCompaniesClient()) { try { var comp = new ServiceManager.Companies(); comp.Method = "GetAllCustomersToDropDown"; comp = servicCompany.ManageCompanies(comp); foreach (var listComp in comp.list) { Compname = listComp.Item1; idComp = listComp.Item2.ToString(); IDToName company = new IDToName(Compname, idComp); combListCust.Items.Add(company); } } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(String.Format(" Error Get All Customers To DropDown: {0}", ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(String.Format(" Error Get All Customers To DropDown: {0}", ex.Message)); } } } if (combListCust.Items.Count > 0) { combListCust.SelectedIndex = 0; } }
private void InitializeListPriority() { if (IsForSpecificServiceCalls) { combPriority1.Items.Clear(); IDToName calls = new IDToName(this.Priority, this.IdPriority); combPriority1.Items.Add(calls); btnUpdate1.Enabled = true; } else { using (var priorityService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var priority = new ServiceManager.Priority(); priority.Method = "GetAllPrioritiesToDropDown"; priority = priorityService.ManagePriority(priority); foreach (var listPriority in priority.list) { this.Priority = listPriority.Item2;// TypePriority; this.IdPriority = Convert.ToString(listPriority.Item1); IDToName priorityToDrop = new IDToName(this.Priority, this.IdPriority); combPriority1.Items.Add(priorityToDrop); } } catch (FaultException ex) { LogUtils.WriteToLog(string.Format(" Error Get All Priorities To DropDown. Exception: {0}", ex.Message)); LogUtils.SystemEventLogsError(string.Format(" Error Get All Priorities To DropDown. Exception: {0}", ex.Message)); } } if (combPriority1.Items.Count > 0) { combPriority1.SelectedIndex = 0; } } }
private void btnAddPriority_Click(object sender, EventArgs e) { using (var priorityService = new ServiceManager.ServiceSystemCompaniesClient()) { try { var priority = new ServiceManager.Priority(); priority.Method = "Insert"; priority.TypePriority = txtbTypePriority.Text; priorityService.ManagePriority(priority); MessageUtils.LogUtils.WriteToLog(" Add Priority: " + txtbTypePriority.Text); MessageUtils.LogUtils.SystemEventLogsInformation(" Add Priority: " + txtbTypePriority.Text); new MessageUtils.MessageBoxText(string.Format(" עדיפות נוסף בהצלחה: {0}", txtbTypePriority.Text)).OkMessaageBox(); } catch (FaultException ex) { MessageUtils.LogUtils.WriteToLog(string.Format(" Error Add Priority: {0} Exception: {1} ", txtbTypePriority.Text, ex.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Add Priority: {0} Exception: {1} ", txtbTypePriority.Text, ex.Message)); } this.Close(); } }
public void DeleteService(DataGridViewRow dr) { Id = dr.Cells["idService_Services"].Value.ToString(); try { using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient()) { var service = new ServiceManager.Service(); service.Method = "Delete"; service.IdService = Convert.ToInt32(Id); serviceService.MangeServices(service); MessageUtils.LogUtils.WriteToLog(" Delete Row Viewing All Services: " + dr.Cells["servicesName"].Value); MessageUtils.LogUtils.SystemEventLogsInformation(string.Format(" Delete Row Viewing All Services: {0}", dr.Cells["servicesName"].Value)); } } catch (FaultException e) { MessageUtils.LogUtils.WriteToLog(string.Format(" Service Name: {0} Exception: {1} ", dr.Cells["servicesName"].Value, e.Message)); MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Service Name: {0} Exception: {1} ", dr.Cells["servicesName"].Value, e.Message)); } }