public void SaveReturnOutSalesCameraImage(FactoryArgs args, t_BigID SaleCarReturnBillID, t_Image MonitoreImg1, t_Image MonitoreImg2, t_Image MonitoreImg3, t_Image MonitoreImg4) { try { string strDatePath = GetPicturePath(enImagePathType.OutBillPath, DateTime.Now); if (MonitoreImg1.Value != null) { string strImagePath = Path.Combine(strDatePath, SaleCarReturnBillID.Value.ToString() + "_Image1.jpg"); CommonHelper.SaveFile(strImagePath, MonitoreImg1.Value); } if (MonitoreImg2.Value != null) { string strImagePath = Path.Combine(strDatePath, SaleCarReturnBillID.Value.ToString() + "_Image2.jpg"); CommonHelper.SaveFile(strImagePath, MonitoreImg2.Value); } if (MonitoreImg3.Value != null) { string strImagePath = Path.Combine(strDatePath, SaleCarReturnBillID.Value.ToString() + "_Image3.jpg"); CommonHelper.SaveFile(strImagePath, MonitoreImg3.Value); } if (MonitoreImg4.Value != null) { string strImagePath = Path.Combine(strDatePath, SaleCarReturnBillID.Value.ToString() + "_Image4.jpg"); CommonHelper.SaveFile(strImagePath, MonitoreImg4.Value); } } catch (Exception ex) { this._IBLLDbErrorLog.Insert(args, new t_String("服务器端,保存出场图片时报错,退货单号:" + SaleCarReturnBillID.Value.ToString() + "\n错误信息:" + ex.Message)); throw ex; } }
public void Insert(FactoryArgs args, out t_BigID WeightLogID, t_DTSmall InWeightTime, t_Image CameraBuffer, t_Image ScreenBuffer) { WeightLogID = new t_BigID(); _DALSalesCarWeightLog.Insert(args, out WeightLogID); SaveCameraImage(args, WeightLogID, new t_ID(0), CameraBuffer, ScreenBuffer); }
public void Update(FactoryArgs args, t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_BigID ReportTypeID, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse, t_ID PrintCount) { using (DataTable dtExistsName = _DALDbReportTemplate.ExistsTemplateName(args, ReportTemplateName, ReportTypeID)) { if (dtExistsName.Rows.Count > 0)//校验上级权限组是否存在 { dtExistsName.DefaultView.RowFilter = "ReportTemplateID<>" + ReportTemplateID.Value; if (dtExistsName.DefaultView.Count == 0) { _DALDbReportTemplate.Update(args, ReportTemplateID, ReportTemplateName, TemplateFileTime, TemplateSeq, Description, TemplateData, ReportTypeID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse, PrintCount); } else { throw new Exception("该报表名称已存在!"); } } else { _DALDbReportTemplate.Update(args, ReportTemplateID, ReportTemplateName, TemplateFileTime, TemplateSeq, Description, TemplateData, ReportTypeID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse, PrintCount); } } }
public void Update(FactoryArgs args, t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_BigID ReportTypeID, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse, t_ID PrintCount) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID)); parms.Add(new LBDbParameter("ReportTemplateName", ReportTemplateName)); parms.Add(new LBDbParameter("TemplateSeq", TemplateSeq)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("PrinterName", PrinterName)); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("IsManualPaperType", IsManualPaperType)); parms.Add(new LBDbParameter("PaperType", PaperType)); parms.Add(new LBDbParameter("IsManualPaperSize", IsManualPaperSize)); parms.Add(new LBDbParameter("PaperSizeHeight", PaperSizeHeight)); parms.Add(new LBDbParameter("PaperSizeWidth", PaperSizeWidth)); parms.Add(new LBDbParameter("IsPaperTransverse", IsPaperTransverse)); parms.Add(new LBDbParameter("PrintCount", PrintCount)); parms.Add(new LBDbParameter("TemplateData", TemplateData)); parms.Add(new LBDbParameter("TemplateFileTime", TemplateFileTime)); string strSQL = @" update dbo.DbReportTemplate set ReportTemplateName = @ReportTemplateName, TemplateSeq=@TemplateSeq, Description=@Description, TemplateData = isnull(@TemplateData,TemplateData), TemplateFileTime = (case when @TemplateData is null then TemplateFileTime else @TemplateFileTime end) where ReportTemplateID = @ReportTemplateID if not exists(select 1 from dbo.DbPrinterConfig where ReportTemplateID = @ReportTemplateID and MachineName = @MachineName) begin insert dbo.DbPrinterConfig( ReportTemplateID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse,PrintCount) values(@ReportTemplateID, @PrinterName, @MachineName, @IsManualPaperType, @PaperType, @IsManualPaperSize, @PaperSizeHeight, @PaperSizeWidth, @IsPaperTransverse,@PrintCount) end else begin update dbo.DbPrinterConfig set PrinterName = @PrinterName, IsManualPaperType = @IsManualPaperType, PaperType = @PaperType, IsManualPaperSize = @IsManualPaperSize, PaperSizeHeight = @PaperSizeHeight, PaperSizeWidth = @PaperSizeWidth, IsPaperTransverse = @IsPaperTransverse, PrintCount = @PrintCount where ReportTemplateID = @ReportTemplateID and MachineName = @MachineName end "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Insert(FactoryArgs args, out t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_BigID ReportTypeID, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse) { ReportTemplateID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID, true)); parms.Add(new LBDbParameter("ReportTemplateName", ReportTemplateName)); parms.Add(new LBDbParameter("TemplateFileTime", TemplateFileTime)); parms.Add(new LBDbParameter("TemplateSeq", TemplateSeq)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("TemplateData", TemplateData)); parms.Add(new LBDbParameter("ReportTypeID", ReportTypeID)); parms.Add(new LBDbParameter("PrinterName", PrinterName)); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("IsManualPaperType", IsManualPaperType)); parms.Add(new LBDbParameter("PaperType", PaperType)); parms.Add(new LBDbParameter("IsManualPaperSize", IsManualPaperSize)); parms.Add(new LBDbParameter("PaperSizeHeight", PaperSizeHeight)); parms.Add(new LBDbParameter("PaperSizeWidth", PaperSizeWidth)); parms.Add(new LBDbParameter("IsPaperTransverse", IsPaperTransverse)); string strSQL = @" insert into dbo.DbReportTemplate( ReportTemplateName,ReportTemplateNameExt, TemplateFileTime,TemplateSeq,Description,TemplateData,ReportTypeID) values( @ReportTemplateName,'.frx', @TemplateFileTime,@TemplateSeq,@Description,@TemplateData,@ReportTypeID); select last_insert_rowid() as ReportTemplateID; insert into dbo.DbPrinterConfig( ReportTemplateID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse) values(@ReportTemplateID, @PrinterName, @MachineName, @IsManualPaperType, @PaperType, @IsManualPaperSize, @PaperSizeHeight, @PaperSizeWidth, @IsPaperTransverse); "; if (args.DBType == 1) { strSQL = @" insert into dbo.DbReportTemplate( ReportTemplateName,ReportTemplateNameExt, TemplateFileTime,TemplateSeq,Description,TemplateData,ReportTypeID) values( @ReportTemplateName,'.frx', @TemplateFileTime,@TemplateSeq,@Description,@TemplateData,@ReportTypeID) select @@identity as ReportTemplateID insert into dbo.DbPrinterConfig( ReportTemplateID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse) values(@ReportTemplateID, @PrinterName, @MachineName, @IsManualPaperType, @PaperType, @IsManualPaperSize, @PaperSizeHeight, @PaperSizeWidth, @IsPaperTransverse) "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); ReportTemplateID.SetValueWithObject(parms["ReportTemplateID"].Value); }
public void SaveCameraImage(FactoryArgs args, t_BigID WeightLogID, t_ID CarWeightStatus, t_Image CameraBuffer, t_Image ScreenBuffer) { try { string strDatePath = GetPicturePath(DateTime.Now); if (CameraBuffer.Value != null) { string strImagePath = Path.Combine(strDatePath, WeightLogID.Value.ToString() + "_Image_Camera_" + CarWeightStatus.Value.ToString() + ".jpg"); CommonHelper.SaveFile(strImagePath, CameraBuffer.Value); } if (ScreenBuffer.Value != null) { string strImagePath = Path.Combine(strDatePath, WeightLogID.Value.ToString() + "_Image_Screen_" + CarWeightStatus.Value.ToString() + ".jpg"); CommonHelper.SaveFile(strImagePath, ScreenBuffer.Value); } } catch (Exception ex) { } }
public void Insert(FactoryArgs args, out t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_BigID ReportTypeID, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse, t_ID PrintCount) { ReportTemplateID = new t_BigID(); using (DataTable dtExistsName = _DALDbReportTemplate.ExistsTemplateName(args, ReportTemplateName, ReportTypeID)) { if (dtExistsName.Rows.Count > 0)//校验上级权限组是否存在 { throw new Exception("该报表名称已存在!"); } else { _DALDbReportTemplate.Insert(args, out ReportTemplateID, ReportTemplateName, TemplateFileTime, TemplateSeq, Description, TemplateData, ReportTypeID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse, PrintCount); } } }
public void UpdateOutTime(FactoryArgs args, t_BigID WeightLogID, t_Image CameraBuffer, t_Image ScreenBuffer) { _DALSalesCarWeightLog.UpdateOutTime(args, WeightLogID); SaveCameraImage(args, WeightLogID, new t_ID(2), CameraBuffer, ScreenBuffer); }
public void GetCameraImage(FactoryArgs args, t_BigID WeightLogID, out t_Image InWeightCamera, out t_Image InWeightScreen, out t_Image SteadyWeightCamera, out t_Image SteadyWeightScreen, out t_Image OutWeightCamera, out t_Image OutWeightScreen) { InWeightCamera = new t_Image(); InWeightScreen = new t_Image(); SteadyWeightCamera = new t_Image(); SteadyWeightScreen = new t_Image(); OutWeightCamera = new t_Image(); OutWeightScreen = new t_Image(); t_DTSmall InWeightTime = new t_DTSmall(); t_DTSmall SteadyWeightTime = new t_DTSmall(); t_DTSmall OutWeightTime = new t_DTSmall(); using (DataTable dtBill = _DALSalesCarWeightLog.GetSalesCarWeightLog(args, WeightLogID)) { if (dtBill.Rows.Count > 0) { DataRow drBill = dtBill.Rows[0]; InWeightTime.SetValueWithObject(drBill["InWeightTime"]); SteadyWeightTime.SetValueWithObject(drBill["SteadyWeightTime"]); OutWeightTime.SetValueWithObject(drBill["OutWeightTime"]); } } //读取入场图片 if (InWeightTime.Value != null) { string strInPath = GetPicturePath((DateTime)InWeightTime.Value); string strPathImg1 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Camera_0.jpg"); string strPathImg2 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Screen_0.jpg"); if (File.Exists(strPathImg1)) { InWeightCamera.SetValueWithObject(CommonHelper.ReadFile(strPathImg1)); } if (File.Exists(strPathImg2)) { InWeightScreen.SetValueWithObject(CommonHelper.ReadFile(strPathImg2)); } } if (SteadyWeightTime.Value != null) { string strInPath = GetPicturePath((DateTime)SteadyWeightTime.Value); string strPathImg1 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Camera_1.jpg"); string strPathImg2 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Screen_1.jpg"); if (File.Exists(strPathImg1)) { SteadyWeightCamera.SetValueWithObject(CommonHelper.ReadFile(strPathImg1)); } if (File.Exists(strPathImg2)) { SteadyWeightScreen.SetValueWithObject(CommonHelper.ReadFile(strPathImg2)); } } if (OutWeightTime.Value != null) { string strInPath = GetPicturePath((DateTime)OutWeightTime.Value); string strPathImg1 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Camera_2.jpg"); string strPathImg2 = Path.Combine(strInPath, WeightLogID.Value.ToString() + "_Image_Screen_2.jpg"); if (File.Exists(strPathImg1)) { OutWeightCamera.SetValueWithObject(CommonHelper.ReadFile(strPathImg1)); } if (File.Exists(strPathImg2)) { OutWeightScreen.SetValueWithObject(CommonHelper.ReadFile(strPathImg2)); } } }
public void UpdateReportTemplate(FactoryArgs args, t_BigID ReportTemplateID, t_DTSmall TemplateFileTime, t_Image TemplateData) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID)); parms.Add(new LBDbParameter("TemplateFileTime", TemplateFileTime)); parms.Add(new LBDbParameter("TemplateData", TemplateData)); string strSQL = @" update dbo.DbReportTemplate set TemplateFileTime=@TemplateFileTime, TemplateData=isnull(@TemplateData,TemplateData) where ReportTemplateID = @ReportTemplateID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void UpdateReportTemplate(FactoryArgs args, t_BigID ReportTemplateID, t_DTSmall TemplateFileTime, t_Image TemplateData) { _DALDbReportTemplate.UpdateReportTemplate(args, ReportTemplateID, TemplateFileTime, TemplateData); }
public void Update(FactoryArgs args, t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID)); parms.Add(new LBDbParameter("ReportTemplateName", ReportTemplateName)); parms.Add(new LBDbParameter("TemplateFileTime", TemplateFileTime)); parms.Add(new LBDbParameter("TemplateSeq", TemplateSeq)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("TemplateData", TemplateData)); parms.Add(new LBDbParameter("PrinterName", PrinterName)); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("IsManualPaperType", IsManualPaperType)); parms.Add(new LBDbParameter("PaperType", PaperType)); parms.Add(new LBDbParameter("IsManualPaperSize", IsManualPaperSize)); parms.Add(new LBDbParameter("PaperSizeHeight", PaperSizeHeight)); parms.Add(new LBDbParameter("PaperSizeWidth", PaperSizeWidth)); parms.Add(new LBDbParameter("IsPaperTransverse", IsPaperTransverse)); string strSQL = @" update dbo.DbReportTemplate set ReportTemplateName = @ReportTemplateName, TemplateFileTime=@TemplateFileTime, TemplateSeq=@TemplateSeq, Description=@Description, TemplateData=isnull(@TemplateData,TemplateData) where ReportTemplateID = @ReportTemplateID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); LBDbParameterCollection parms1 = new LBDbParameterCollection(); parms1.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID)); strSQL = "select 1 from dbo.DbPrinterConfig where ReportTemplateID = @ReportTemplateID"; using (DataTable dtResult = DBHelper.ExecuteQuery(args, strSQL, parms1)) { if (dtResult.Rows.Count > 0) { strSQL = @"insert dbo.DbPrinterConfig( ReportTemplateID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse) values(@ReportTemplateID, @PrinterName, @MachineName, @IsManualPaperType, @PaperType, @IsManualPaperSize, @PaperSizeHeight, @PaperSizeWidth, @IsPaperTransverse)"; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); } else { strSQL = @"update dbo.DbPrinterConfig set PrinterName = @PrinterName, MachineName = @MachineName, IsManualPaperType = @IsManualPaperType, PaperType = @PaperType, IsManualPaperSize = @IsManualPaperSize, PaperSizeHeight = @PaperSizeHeight, PaperSizeWidth = @PaperSizeWidth, IsPaperTransverse = @IsPaperTransverse where ReportTemplateID = @ReportTemplateID"; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); } } }
public void GetCameraImage(FactoryArgs args, t_BigID SaleCarReturnBillID, out t_Image InMonitoreImg1, out t_Image InMonitoreImg2, out t_Image InMonitoreImg3, out t_Image InMonitoreImg4, out t_Image OutMonitoreImg1, out t_Image OutMonitoreImg2, out t_Image OutMonitoreImg3, out t_Image OutMonitoreImg4) { InMonitoreImg1 = new t_Image(); InMonitoreImg2 = new t_Image(); InMonitoreImg3 = new t_Image(); InMonitoreImg4 = new t_Image(); OutMonitoreImg1 = new t_Image(); OutMonitoreImg2 = new t_Image(); OutMonitoreImg3 = new t_Image(); OutMonitoreImg4 = new t_Image(); t_DTSmall CarInTime = new t_DTSmall(); t_DTSmall CarOutTime = new t_DTSmall(); using (DataTable dtBill = _DALSaleCarReturnBill.GetReturnBill(args, SaleCarReturnBillID)) { if (dtBill.Rows.Count > 0) { DataRow drBill = dtBill.Rows[0]; CarInTime.SetValueWithObject(drBill["CarInTime"]); CarOutTime.SetValueWithObject(drBill["CarOutTime"]); } } //读取入场图片 if (CarInTime.Value != null) { string strInPath = GetPicturePath(enImagePathType.InBillPath, (DateTime)CarInTime.Value); string strPathImg1 = Path.Combine(strInPath, SaleCarReturnBillID.Value.ToString() + "_Image1.jpg"); string strPathImg2 = Path.Combine(strInPath, SaleCarReturnBillID.Value.ToString() + "_Image2.jpg"); string strPathImg3 = Path.Combine(strInPath, SaleCarReturnBillID.Value.ToString() + "_Image3.jpg"); string strPathImg4 = Path.Combine(strInPath, SaleCarReturnBillID.Value.ToString() + "_Image4.jpg"); if (File.Exists(strPathImg1)) { InMonitoreImg1.SetValueWithObject(CommonHelper.ReadFile(strPathImg1)); } if (File.Exists(strPathImg2)) { InMonitoreImg2.SetValueWithObject(CommonHelper.ReadFile(strPathImg2)); } if (File.Exists(strPathImg3)) { InMonitoreImg3.SetValueWithObject(CommonHelper.ReadFile(strPathImg3)); } if (File.Exists(strPathImg4)) { InMonitoreImg4.SetValueWithObject(CommonHelper.ReadFile(strPathImg4)); } } //读取出场图片 if (CarOutTime.Value != null) { string strOutPath = GetPicturePath(enImagePathType.OutBillPath, (DateTime)CarOutTime.Value); string strPathImg1 = Path.Combine(strOutPath, SaleCarReturnBillID.Value.ToString() + "_Image1.jpg"); string strPathImg2 = Path.Combine(strOutPath, SaleCarReturnBillID.Value.ToString() + "_Image2.jpg"); string strPathImg3 = Path.Combine(strOutPath, SaleCarReturnBillID.Value.ToString() + "_Image3.jpg"); string strPathImg4 = Path.Combine(strOutPath, SaleCarReturnBillID.Value.ToString() + "_Image4.jpg"); if (File.Exists(strPathImg1)) { OutMonitoreImg1.SetValueWithObject(CommonHelper.ReadFile(strPathImg1)); } if (File.Exists(strPathImg2)) { OutMonitoreImg2.SetValueWithObject(CommonHelper.ReadFile(strPathImg2)); } if (File.Exists(strPathImg3)) { OutMonitoreImg3.SetValueWithObject(CommonHelper.ReadFile(strPathImg3)); } if (File.Exists(strPathImg4)) { OutMonitoreImg4.SetValueWithObject(CommonHelper.ReadFile(strPathImg4)); } } }