Exemplo n.º 1
0
 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));
         }
     }
 }
Exemplo n.º 2
0
 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);
             }
         }
     }
 }
Exemplo n.º 3
0
 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 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();
     }
 }
 private void btnUpdate1_Click(object sender, EventArgs e)
 {
     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       = "Update";
                 serviceCall.discriptions = Discription;
                 serviceCall.status       = status;
                 myServiceCalls.ManageServiceCalls(serviceCall);
                 LogUtils.WriteToLog(" Update Service Calls");
                 LogUtils.SystemEventLogsInformation(" Update Service Calls");
                 new MessageBoxText("עודכן בהצלחה").OkMessaageBox();
                 this.DialogResult = DialogResult.OK;
             }
             else
             {
                 LogUtils.WriteToLog(" Update Service Calls faild!!!! Service Calls dosn't exist");
                 LogUtils.SystemEventLogsInformation(" Update Service Calls faild!!!! Service Calls dosn't exist");
                 new MessageBoxText("Update Service Calls faild!!!! Service Calls dosn't exist").WarningMessageBox();
                 this.DialogResult = DialogResult.OK;
             }
         }
         catch (FaultException ex)
         {
             LogUtils.WriteToLog(string.Format(" Update Service Calls faild!!!! Exception: {0}", ex.Message));
             LogUtils.SystemEventLogsInformation(string.Format(" Update Service Calls faild!!!! Exception: {0}", ex.Message));
             new MessageBoxText("Update Service Calls faild!!!!").ErrorMessageBox();
         }
     }
     this.Close();
 }