private DataSet GetReportCotizacion(string pstrProtocolId) { //OperationResult objOperationResult = new OperationResult(); //var rp = new Reports.crCotizacion(); //var OrderService = new ServiceOrderBL().GetReportCotizacion(_serviceOrderId, pstrProtocolId); //var x = OrderService.FindAll(P => P.r_Price != 0); // eliminamos los componentes con precio 0 //DataSet ds = new DataSet(); //DataTable dt = Sigesoft.Node.WinClient.BLL.Utils.ConvertToDatatable(x); //dt.TableName = "ServiceOrder"; //ds.Tables.Add(dt); //rp.SetDataSource(ds); //crystalReportViewer1.ReportSource = rp; //crystalReportViewer1.Show(); var dataListForReport = new ServiceOrderBL().GetReportServiceOrder(_serviceOrderId, pstrProtocolId).FindAll(p => p.r_Price != 0); dsGetRepo = new DataSet(); DataTable dt = Sigesoft.Node.WinClient.BLL.Utils.ConvertToDatatable(dataListForReport); dt.TableName = "ServiceOrder"; dsGetRepo.Tables.Add(dt); return(dsGetRepo); }
private void GetService() { try { dtSevices = new DataTable(); dtSevices = ServiceOrderBL.GetServices(); if (dtSevices.Rows.Count > 0) { DataColumn dtcCheck = new DataColumn("Select") /*column object with the name */ DataType { = Type.GetType("System.Boolean") /*Set its */, /*data Type */ DefaultValue = false /*Set the default value*/ }; //create the data dtSevices.Columns.Add(dtcCheck); //Add the above column to the if (m_lservId != "") { DataView dv = new DataView(dtSevices); dv.RowFilter = "ServiceId Not In(" + m_lservId.TrimEnd(',').ToString() + ")"; dtSevices = dv.ToTable(); } if (dtSevices.Rows.Count == 0) { return; } grdService.DataSource = dtSevices; grdViewService.Columns["ServiceId"].Visible = false; grdViewService.BestFitColumns(); grdViewService.Columns["Select"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewService.OptionsView.ColumnAutoWidth = true; grdViewService.Appearance.HeaderPanel.Font = new Font(grdViewService.Appearance.HeaderPanel.Font, FontStyle.Bold); }
public IHttpActionResult GenerateServiceOrderReport(MultiDataModel multiData) { BoardServiceOrder data = JsonConvert.DeserializeObject <BoardServiceOrder>(multiData.String1); var result = ServiceOrderBL.GenerateServiceOrderReport(data, multiData.Int1, data.FechaEmision); return(Ok(result)); }
public IHttpActionResult AddServiceOrder(MultiDataModel multiData) { BoardServiceOrder data = JsonConvert.DeserializeObject <BoardServiceOrder>(multiData.String1); var result = ServiceOrderBL.AddServiceOrder(data, multiData.Int1, multiData.Int2); return(Ok(result)); }
private void btnSendEmail_Click_1(object sender, EventArgs e) { ServiceOrderBL oServiceOrderBL = new ServiceOrderBL(); List <string> ListaProtocolos = new List <string>(); var Lista = oServiceOrderBL.ObtenerProtocolos(_ServiceOrderId); foreach (var item in Lista) { ListaProtocolos.Add(item.Value1); } frmEmailOrdenServicioCotizacion frm = new frmEmailOrdenServicioCotizacion(_ServiceOrderId, ListaProtocolos); frm.ShowDialog(); }
private DataSet GetReportServiceOrder(string pstrProtocolId) { var dataListForReport = new ServiceOrderBL().GetReportServiceOrder(_serviceOrderId, pstrProtocolId).FindAll(p => p.r_Price != 0); dsGetRepo = new DataSet(); DataTable dt = Sigesoft.Node.WinClient.BLL.Utils.ConvertToDatatable(dataListForReport); dt.TableName = "ServiceOrder"; dsGetRepo.Tables.Add(dt); return(dsGetRepo); }
private void btnCotizacion_Click(object sender, EventArgs e) { ServiceOrderBL oServiceOrderBL = new ServiceOrderBL(); var Lista = oServiceOrderBL.ObtenerProtocolos(_ServiceOrderId); List <string> ListaProtocolos = new List <string>(); foreach (var item in Lista) { ListaProtocolos.Add(item.Value1); } var frm = new Reports.frmConsolidateCotizacion(_ServiceOrderId, ListaProtocolos); frm.ShowDialog(); //Reports.frmReporteCotizacion frm = new Reports.frmReporteCotizacion(_ServiceOrderId); //frm.ShowDialog(); }
private void ShowReport() { OperationResult objOperationResult = new OperationResult(); var rp = new Reports.crCotizacion(); var OrderService = new ServiceOrderBL().GetReportServiceOrder(_ServiceOrderId, ""); var x = OrderService.FindAll(P => P.r_Price != 0); // eliminamos los componentes con precio 0 DataSet ds = new DataSet(); DataTable dt = Sigesoft.Node.WinClient.BLL.Utils.ConvertToDatatable(x); dt.TableName = "ServiceOrder"; ds.Tables.Add(dt); rp.SetDataSource(ds); crystalReportViewer1.ReportSource = rp; crystalReportViewer1.Show(); }
private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { if (DGvTransView.FocusedRowHandle < 0) { return; } if (BsfGlobal.FindPermission("Service-Quote-Delete") == false) { MessageBox.Show("You don't have Rights to Service Quote Register-Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } try { int i_RegId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RegisterId"), CommFun.datatypes.vartypenumeric)); string m_sIssNo = ""; int m_iCCId1 = 0; string Apv = ""; m_iCCId1 = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "CostcentreID"), CommFun.datatypes.vartypenumeric)); m_sIssNo = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RefNo"), CommFun.datatypes.vartypestring)); Apv = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring)); if (Apv == "Y") { MessageBox.Show("Already Approved, Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (ServiceOrderBL.DeleteSerQuoteRegister(i_RegId, m_iCCId1, m_sIssNo) == true) { DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle); } // CommFun.InsertLog(DateTime.Now, "Service Quote Register-Delete", "D", "Delete Service Quote Register", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName); } } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
private void btnAgregar_Click(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); ServiceOrderBL oServiceOrderlBL = new ServiceOrderBL(); ProtocolBL oProtocolBL = new ProtocolBL(); ProtocolList oProtocolList = new ProtocolList(); int CantidadTrabajadores = 0; #region if (txtProtocolName.Text.Trim() == String.Empty) { MessageBox.Show("Por favor seleccione un Protocolo.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txtNroTrabajadores.Text.Trim() == "" || txtNroTrabajadores.Text.Trim() == "0") { MessageBox.Show("El N° de Trabajadores no puede ser 0 o vacío", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (CantidadTrabajadores.ToString() != "") { CantidadTrabajadores = int.Parse(txtNroTrabajadores.Text.ToString()); } float CostoTotal = 0; int TotalTrabajadores = 0; #endregion if (_TempServiceOrderDetail == null) { _TempServiceOrderDetail = new List <ServiceOrderDetailList>(); } grdData1.DataSource = new ServiceOrderDetailList(); _objServiceOrderDetailList = new ServiceOrderDetailList(); oProtocolList = oProtocolBL.GetProtocolById(ref objOperationResult, _ProtocolId); //Buscar si un producto ya esta en la Grilla var findResult = _TempServiceOrderDetail.Find(p => p.v_ProtocolId == _ProtocolId); if (findResult == null) { _objServiceOrderDetailList.v_ProtocolId = _ProtocolId; _objServiceOrderDetailList.v_ProtocolName = oProtocolList.v_Name; _objServiceOrderDetailList.i_NumberOfWorkerProtocol = CantidadTrabajadores; _objServiceOrderDetailList.r_ProtocolPrice = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId).Sum(s => s.r_Price); _objServiceOrderDetailList.r_Total = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId).Sum(s => s.r_Price) * CantidadTrabajadores; _TempServiceOrderDetail.Add(_objServiceOrderDetailList); grdData1.DataSource = _TempServiceOrderDetail; } else { var findIndex = _TempServiceOrderDetail.FindIndex(p => p.v_ProtocolId == _ProtocolId); _objServiceOrderDetailList.v_ProtocolId = _ProtocolId; _objServiceOrderDetailList.v_ProtocolName = oProtocolList.v_Name; _objServiceOrderDetailList.i_NumberOfWorkerProtocol = CantidadTrabajadores; _objServiceOrderDetailList.r_ProtocolPrice = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId).Sum(s => s.r_Price); _objServiceOrderDetailList.r_Total = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId).Sum(s => s.r_Price) * CantidadTrabajadores; _TempServiceOrderDetail.Add(_objServiceOrderDetailList); _TempServiceOrderDetail.RemoveAt(findIndex); grdData1.DataSource = _TempServiceOrderDetail; } grdData1.Refresh(); //Limpiar controles txtProtocolName.Text = string.Empty; txtOrganitation.Text = string.Empty; txtContact.Text = string.Empty; txtAdress.Text = string.Empty; txttypeProtocol.Text = string.Empty; txtNroTrabajadores.Text = string.Empty; //_TempServiceOrderDetail = oServiceOrderlBL.GetServiceOrderDetailList(_ProtocolId); foreach (var item in _TempServiceOrderDetail) { CostoTotal += (float)item.r_Total; TotalTrabajadores += (int)item.i_NumberOfWorkerProtocol; } //grdData.DataSource = _TempServiceOrderDetail; txtTotal.Text = CostoTotal.ToString(); txtTotalTrabajadores.Text = TotalTrabajadores.ToString(); //Calcular(); }
public void FillData() { try { DataTable dtCompL = new DataTable(); //string sql = "Select A.RegisterId,A.SDate,A.RefNo,B.CostCentreName,C.FlatNo,E.LeadName BuyerName, A.NetAmt from ServiceQuoteReg A " + // "Inner Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.OperationalCostCentre B on A.CostCentreId=B.CostCentreId " + // "Inner Join FlatDetails C on A.FlatId=C.FlatId " + // "Left Join BuyerDetail D on A.LeadId=D.LeadId " + // "Left Join LeadRegister E on D.LeadId=E.LeadId " + // "Order by A.SDate,A.RefNo"; dtCompL = ServiceOrderBL.Fill_SerQuoteRegister(Convert.ToDateTime(dtpFrmDate.EditValue), Convert.ToDateTime(dtpToDate.EditValue)); DGvTrans.DataSource = dtCompL; RepositoryItemTextEdit txtEditAmt = new RepositoryItemTextEdit(); txtEditAmt.LookAndFeel.UseDefaultLookAndFeel = false; txtEditAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat; txtEditAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; txtEditAmt.Mask.UseMaskAsDisplayFormat = true; DGvTransView.Columns["NetAmt"].ColumnEdit = txtEditAmt; DGvTransView.Columns["RegisterId"].Visible = false; DGvTransView.Columns["CostcentreID"].Visible = false; DGvTransView.Columns["SDate"].Caption = "Date"; DGvTransView.Columns["SDate"].Width = 100; DGvTransView.Columns["RefNo"].Width = 100; DGvTransView.Columns["CostCentreName"].Width = 200; DGvTransView.Columns["FlatNo"].Width = 100; DGvTransView.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No"; DGvTransView.Columns["BuyerName"].Width = 150; DGvTransView.Columns["NetAmt"].Caption = "NetAmount"; DGvTransView.Columns["NetAmt"].Width = 100; DGvTransView.Columns["SDate"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; DGvTransView.Columns["Approve"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; DGvTransView.Columns["RefNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["RefNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["FlatNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["FlatNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["SDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["SDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.OptionsCustomization.AllowFilter = true; DGvTransView.OptionsBehavior.AllowIncrementalSearch = true; DGvTransView.OptionsView.ShowAutoFilterRow = true; DGvTransView.OptionsView.ShowViewCaption = false; DGvTransView.OptionsView.ShowFooter = false; DGvTransView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect; DGvTransView.OptionsSelection.InvertSelection = false; DGvTransView.OptionsView.ColumnAutoWidth = true; DGvTransView.Appearance.HeaderPanel.Font = new Font(DGvTransView.Appearance.HeaderPanel.Font, FontStyle.Bold); DGvTransView.FocusedRowHandle = 0; DGvTransView.FocusedColumn = DGvTransView.VisibleColumns[0]; DGvTransView.Appearance.FocusedCell.BackColor = Color.Teal; DGvTransView.Appearance.FocusedCell.ForeColor = Color.White; DGvTransView.Appearance.FocusedRow.ForeColor = Color.Black; DGvTransView.Appearance.FocusedRow.BackColor = Color.White; DGvTransView.OptionsSelection.EnableAppearanceHideSelection = false; } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
public IHttpActionResult DeletedServiceOrderDetail(string serviceOrderDetail, int userId) { var result = ServiceOrderBL.DeletedServiceOrderDetail(serviceOrderDetail, userId); return(Ok(result)); }
public IHttpActionResult GetServicesOrderDetail(string serviceOrderId) { var result = ServiceOrderBL.GetServicesOrderDetail(serviceOrderId); return(Ok(result)); }
public frmServiceOrderPList() { InitializeComponent(); oPaySerBL = new ServiceOrderBL(); }