/// <summary> /// 估价执行:零件清单Info /// </summary> /// <param name="dr">数据</param> public ValComponentInfo(DataRow dr) : this() { this.User.ID = SQLUtil.ConvertInt(dr["UserID"]); this.User.Name = SQLUtil.TrimNull(dr["UserName"]); this.InSystem = SQLUtil.ConvertBoolean(dr["InSystem"]); this.Equipment.ID = SQLUtil.ConvertInt(dr["EquipmentID"]); this.Equipment.Name = SQLUtil.TrimNull(dr["Name"]); this.Equipment.AssetCode = SQLUtil.TrimNull(dr["AssetCode"]); this.EquipmentType.ID = SQLUtil.ConvertInt(dr["EquipmentType"]); this.EquipmentType.Name = LookupManager.GetEquipmentTypeDesc(this.EquipmentType.ID); this.Equipment.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); this.Component.ID = SQLUtil.ConvertInt(dr["ComponentID"]); this.Component.Name = this.Component.ID == 0 ? ComponentType.WholeMachine : SQLUtil.TrimNull(dr["ComponentName"]); this.Component.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Component.StdPrice = SQLUtil.ConvertDouble(dr["StdPrice"]); this.Component.SecondsPer = SQLUtil.ConvertDouble(dr["SecondsPer"]); this.Component.TotalSeconds = SQLUtil.ConvertInt(dr["TotalSeconds"]); this.Component.Usage = SQLUtil.ConvertInt(dr["ComponentUsage"]); this.Qty = SQLUtil.ConvertInt(dr["Qty"]); this.Usage = SQLUtil.ConvertInt(dr["Usage"]); this.Seconds = SQLUtil.ConvertDouble(dr["Seconds"]); this.UsedSeconds = SQLUtil.ConvertDouble(dr["UsedSeconds"]); this.IncludeContract = SQLUtil.ConvertBoolean(dr["IncludeContract"]); this.UsageRefere = SQLUtil.ConvertInt(dr["UsageRefere"]); if (dr.Table.Columns.Contains("UseageDate")) { this.UseageDate = SQLUtil.ConvertDateTime(dr["UseageDate"]); } }
/// <summary> /// 修改零件信息 /// </summary> /// <param name="info">零件信息</param> /// <returns>零件id</returns> public int UpdateComponent(InvComponentInfo info) { sqlStr = "UPDATE tblInvComponent Set ComponentID=@ComponentID,EquipmentID=@EquipmentID,SerialCode=@SerialCode,Specification=@Specification, " + " Model=@Model,SupplierID=@SupplierID,Price=@Price,PurchaseDate=@PurchaseDate," + " PurchaseID=@PurchaseID,Comments=@Comments,StatusID=@StatusID,UpdateDate=GetDate() " + " WHERE ID = @ID"; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@ID", SqlDbType.Int).Value = info.ID; command.Parameters.Add("@ComponentID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Component.ID); command.Parameters.Add("@EquipmentID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Equipment.ID); command.Parameters.Add("@SerialCode", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.SerialCode); command.Parameters.Add("@Specification", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Specification); command.Parameters.Add("@Model", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Model); command.Parameters.Add("@SupplierID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Supplier.ID); command.Parameters.Add("@Price", SqlDbType.Decimal).Value = info.Price; command.Parameters.Add("@PurchaseDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.PurchaseDate); command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Purchase.ID); command.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Comments); command.Parameters.Add("@StatusID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Status.ID); command.ExecuteNonQuery(); return(info.ID); } }
/// <summary> /// 获取作业报告列表 /// </summary> /// <param name="status">作业报告状态</param> /// <param name="urgency">派工单紧急程度</param> /// <param name="filterField">搜索条件</param> /// <param name="filterText">搜索框填写内容</param> /// <param name="sortField">排序字段</param> /// <param name="sortDirection">排序方式</param> /// <param name="curRowNum">当前页数第一个数据的位置</param> /// <param name="pageSize">一页几条数据</param> /// <returns>作业报告列表</returns> public List <DispatchReportInfo> QueryDispatchReports(int status, int urgency, string filterField, string filterText, string sortField, bool sortDirection, int curRowNum = 0, int pageSize = 0) { List <DispatchReportInfo> dispatches = new List <DispatchReportInfo>(); sqlStr = "SELECT DISTINCT d.*,r.ID AS DispatchReportID , r.StatusID AS DispatchReportStatusID ,j.ID as DispatchJournalID, j.StatusID AS DispatchJournalStatusID " + " FROM tblDispatchReport r " + " LEFT JOIN tblDispatch d ON d.ID = r.DispatchID " + " LEFT JOIN tblDispatchJournal j ON d.ID = j.DispatchID " + " WHERE 1=1 "; if (status != 0) { sqlStr += " AND r.StatusID=" + status; } else { sqlStr += " AND r.StatusID <> " + DispatchReportInfo.DispatchReportStatus.Cancelled; } if (urgency != 0) { sqlStr += " AND d.UrgencyID=" + urgency; } if (!string.IsNullOrEmpty(filterText)) { sqlStr += GetFieldFilterClause(filterField); } sqlStr += GenerateSortClause(sortDirection, sortField, "r.ID"); sqlStr = AppendLimitClause(sqlStr, curRowNum, pageSize); using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { if (!String.IsNullOrEmpty(filterText)) { AddFieldFilterParam(command, filterField, filterText); } using (DataTable dt = GetDataTable(command)) { foreach (DataRow dr in dt.Rows) { DispatchReportInfo dispatchReport = new DispatchReportInfo(); dispatchReport.ID = SQLUtil.ConvertInt(dr["DispatchReportID"]); dispatchReport.Status.ID = SQLUtil.ConvertInt(dr["DispatchReportStatusID"]); dispatchReport.Status.Name = LookupManager.GetDispatchDocStatusDesc(dispatchReport.Status.ID); dispatchReport.Dispatch.ID = SQLUtil.ConvertInt(dr["ID"]); dispatchReport.Dispatch.Request.ID = SQLUtil.ConvertInt(dr["RequestID"]); dispatchReport.Dispatch.RequestType.ID = SQLUtil.ConvertInt(dr["RequestType"]); dispatchReport.Dispatch.RequestType.Name = LookupManager.GetRequestTypeDesc(dispatchReport.Dispatch.RequestType.ID); dispatchReport.Dispatch.Urgency.ID = SQLUtil.ConvertInt(dr["UrgencyID"]); dispatchReport.Dispatch.Urgency.Name = LookupManager.GetUrgencyDesc(dispatchReport.Dispatch.Urgency.ID); dispatchReport.Dispatch.ScheduleDate = SQLUtil.ConvertDateTime(dr["ScheduleDate"]); dispatchReport.Dispatch.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); dispatches.Add(dispatchReport); } } } return(dispatches); }
/// <summary> /// 添加服务 /// </summary> /// <param name="info">服务信息</param> /// <returns>服务id</returns> public int AddService(InvServiceInfo info) { sqlStr = "INSERT INTO tblInvService(FujiClass2ID,Name,TotalTimes,Price,StartDate,EndDate,SupplierID,PurchaseID,PurchaseDate,Comments,AvaibleTimes,AddDate) " + " VALUES(@FujiClass2ID,@Name,@TotalTimes,@Price,@StartDate,@EndDate,@SupplierID,@PurchaseID,@PurchaseDate,@Comments,@AvaibleTimes,GetDate()); " + " SELECT @@IDENTITY "; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@FujiClass2ID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.FujiClass2.ID); command.Parameters.Add("@Name", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Name); command.Parameters.Add("@TotalTimes", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.TotalTimes); command.Parameters.Add("@Price", SqlDbType.Decimal).Value = info.Price; command.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.StartDate); command.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.EndDate); command.Parameters.Add("@SupplierID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Supplier.ID); command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Purchase.ID); command.Parameters.Add("@PurchaseDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.PurchaseDate); command.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Comments); command.Parameters.Add("@AvaibleTimes", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.AvaibleTimes); info.ID = SQLUtil.ConvertInt(command.ExecuteScalar()); return(info.ID); } }
public List <EquipmentInfo> GetEquipments() { List <EquipmentInfo> infos = new List <EquipmentInfo>(); sqlStr = "SELECT ID, DepartmentID, InstalEndDate, ScrapDate FROM tblEquipment " + " WHERE DepartmentID NOT IN (4, 9)"; using (SqlCommand command = DatabaseConnection.GetCommand(sqlStr)) { using (DataTable dt = GetDataTable(command)) { EquipmentInfo info = null; foreach (DataRow dr in dt.Rows) { info = new EquipmentInfo(); info.ID = SQLUtil.ConvertInt(dr["ID"]); info.Department.ID = SQLUtil.ConvertInt(dr["DepartmentID"]); info.InstalEndDate = SQLUtil.ConvertDateTime(dr["InstalEndDate"]); info.ScrapDate = SQLUtil.ConvertDateTime(dr["ScrapDate"]); infos.Add(info); } } } return(infos); }
/// <summary> /// 添加零件 /// </summary> /// <param name="info">零件信息</param> /// <returns>零件id</returns> public int AddComponent(InvComponentInfo info) { sqlStr = "INSERT INTO tblInvComponent(ComponentID,EquipmentID,SerialCode,Specification,Model,SupplierID,Price,PurchaseDate,PurchaseID,Comments,StatusID,AddDate) " + " VALUES(@ComponentID,@EquipmentID,@SerialCode,@Specification,@Model,@SupplierID,@Price,@PurchaseDate,@PurchaseID,@Comments,@StatusID,GetDate()); " + " SELECT @@IDENTITY "; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@ComponentID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Component.ID); command.Parameters.Add("@EquipmentID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Equipment.ID); command.Parameters.Add("@SerialCode", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.SerialCode); command.Parameters.Add("@Specification", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Specification); command.Parameters.Add("@Model", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Model); command.Parameters.Add("@SupplierID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Supplier.ID); command.Parameters.Add("@Price", SqlDbType.Decimal).Value = info.Price; command.Parameters.Add("@PurchaseDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.PurchaseDate); command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Purchase.ID); command.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Comments); command.Parameters.Add("@StatusID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Status.ID); info.ID = SQLUtil.ConvertInt(command.ExecuteScalar()); return(info.ID); } }
/// <summary> /// 修改服务信息 /// </summary> /// <param name="info">服务信息</param> /// <returns>服务id</returns> public int UpdateService(InvServiceInfo info) { sqlStr = "UPDATE tblInvService Set FujiClass2ID=@FujiClass2ID,Name=@Name,TotalTimes=@TotalTimes,Price=@Price,StartDate=@StartDate,EndDate=@EndDate, " + " SupplierID=@SupplierID,PurchaseID=@PurchaseID,PurchaseDate=@PurchaseDate,Comments=@Comments,AvaibleTimes=@AvaibleTimes,UpdateDate=GetDate() " + " WHERE ID = @ID"; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@ID", SqlDbType.Int).Value = info.ID; command.Parameters.Add("@FujiClass2ID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.FujiClass2.ID); command.Parameters.Add("@Name", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Name); command.Parameters.Add("@TotalTimes", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.TotalTimes); command.Parameters.Add("@Price", SqlDbType.Decimal).Value = info.Price; command.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.StartDate); command.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.EndDate); command.Parameters.Add("@SupplierID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Supplier.ID); command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Purchase.ID); command.Parameters.Add("@PurchaseDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.PurchaseDate); command.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Comments); command.Parameters.Add("@AvaibleTimes", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.AvaibleTimes); command.ExecuteNonQuery(); return(info.ID); } }
/// <summary> /// 根据设备编号获取生命周期信息 /// </summary> /// <param name="equipmentID">设备ID</param> /// <returns>生命周期信息</returns> public List <DispatchInfo> GetTimeLine(int equipmentID) { List <DispatchInfo> dispatchInfo = new List <DispatchInfo>(); sqlStr = "SELECT dr.SolutionWay, dr.Comments, d.* FROM tblRequest AS r " + " LEFT JOIN jctRequestEqpt AS jc ON jc.RequestID = r.ID " + " LEFT JOIN tblDispatch AS d ON d.RequestID = r.ID " + " LEFT JOIN tblDispatchReport AS dr ON dr.DispatchID = d.ID " + " WHERE jc.EquipmentID = @EquipmentID AND d.EndDate IS NOT NULL " + " ORDER BY d.EndDate DESC, d.ID"; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@EquipmentID", SqlDbType.Int).Value = equipmentID; using (DataTable dt = GetDataTable(command)) { foreach (DataRow dr in dt.Rows) { DispatchInfo info = new DispatchInfo(); info.ID = SQLUtil.ConvertInt(dr["ID"]); info.Request.ID = SQLUtil.ConvertInt(dr["RequestID"]); info.RequestType.ID = SQLUtil.ConvertInt(dr["RequestType"]); info.RequestType.Name = LookupManager.GetRequestTypeDesc(info.RequestType.ID); info.ScheduleDate = SQLUtil.ConvertDateTime(dr["ScheduleDate"]); info.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); info.DispatchReport.SolutionWay = SQLUtil.TrimNull(dr["SolutionWay"]); info.DispatchReport.Comments = SQLUtil.TrimNull(dr["Comments"]); dispatchInfo.Add(info); } } } return(dispatchInfo); }
/// <summary> /// 获取作业报告信息 /// </summary> /// <param name="dr">The dr.</param> public DispatchReportInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.Dispatch.ID = SQLUtil.ConvertInt(dr["DispatchID"]); this.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Type = LookupManager.GetDispatchReportType(this.Type.ID); this.FaultCode = SQLUtil.TrimNull(dr["FaultCode"]); this.FaultDesc = SQLUtil.TrimNull(dr["FaultDesc"]); this.SolutionCauseAnalysis = SQLUtil.TrimNull(dr["SolutionCauseAnalysis"]); this.SolutionWay = SQLUtil.TrimNull(dr["SolutionWay"]); this.IsPrivate = SQLUtil.ConvertBoolean(dr["IsPrivate"]); this.ServiceProvider.ID = SQLUtil.ConvertInt(dr["ServiceProvider"]); this.ServiceProvider.Name = ServiceProviders.GetDescByID(this.ServiceProvider.ID); this.SolutionResultStatus.ID = SQLUtil.ConvertInt(dr["SolutionResultStatusID"]); this.SolutionResultStatus.Name = LookupManager.GetSolutionResultStatusDesc(this.SolutionResultStatus.ID); this.SolutionUnsolvedComments = SQLUtil.TrimNull(dr["SolutionUnsolvedComments"]); this.DelayReason = SQLUtil.TrimNull(dr["DelayReason"]); this.Comments = SQLUtil.TrimNull(dr["Comments"]); this.FujiComments = SQLUtil.TrimNull(dr["FujiComments"]); this.Status.ID = SQLUtil.ConvertInt(dr["StatusID"]); this.Status.Name = LookupManager.GetDispatchDocStatusDesc(this.Status.ID); this.PurchaseAmount = SQLUtil.ConvertDouble(dr["PurchaseAmount"]); this.ServiceScope = SQLUtil.ConvertBoolean(dr["ServiceScope"]); this.ServiceScope = SQLUtil.ConvertBoolean(dr["ServiceScope"]); this.Result = SQLUtil.TrimNull(dr["Result"]); this.IsRecall = SQLUtil.ConvertBoolean(dr["IsRecall"]); this.AcceptanceDate = SQLUtil.ConvertDateTime(dr["AcceptanceDate"]); this.EquipmentStatus.ID = SQLUtil.ConvertInt(dr["EquipmentStatus"]); this.EquipmentStatus.Name = MachineStatuses.GetMachineStatusesDesc(this.EquipmentStatus.ID); }
/// <summary> /// 获取用户信息 /// </summary> /// <param name="dr">The dr.</param> public UserInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.LoginID = SQLUtil.TrimNull(dr["LoginID"]); this.LoginPwd = SQLUtil.TrimNull(dr["LoginPwd"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Role.ID = SQLUtil.ConvertInt(dr["RoleID"]); this.Role.Name = Manager.LookupManager.GetRoleDesc(this.Role.ID); this.Mobile = SQLUtil.TrimNull(dr["Mobile"]); this.Email = SQLUtil.TrimNull(dr["Email"]); this.Address = SQLUtil.TrimNull(dr["Address"]); this.IsActive = SQLUtil.ConvertBoolean(dr["IsActive"]); this.LastLoginDate = SQLUtil.ConvertDateTime(dr["LastLoginDate"]); this.SessionID = SQLUtil.TrimNull(dr["SessionID"]); this.WebSessionID = SQLUtil.TrimNull(dr["WebSessionID"]); this.CreatedDate = SQLUtil.ConvertDateTime(dr["CreatedDate"]); this.RegistrationID = SQLUtil.TrimNull(dr["RegistrationID"]); this.OSName = SQLUtil.TrimNull(dr["OSName"]); this.VerifyStatus.ID = SQLUtil.ConvertInt(dr["VerifyStatus"]); this.VerifyStatus.Name = BusinessObjects.Domain.VerifyStatus.GetVerifyStatusDesc(this.VerifyStatus.ID); this.Comments = SQLUtil.TrimNull(dr["Comments"]); this.Department.ID = SQLUtil.ConvertInt(dr["Department"]); this.Department.Name = Manager.LookupManager.GetDepartmentDesc(this.Department.ID); if (dr.Table.Columns.Contains("HasOpenDispatch")) { this.HasOpenDispatch = SQLUtil.ConvertBoolean(dr["HasOpenDispatch"]); } }
/// <summary> /// 富士I类info /// </summary> /// <param name="dr">dr</param> public FujiClass1Info(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); if (dr.Table.Columns.Contains("EquipmentType1ID")) { this.EquipmentType1.Code = SQLUtil.TrimNull(dr["EquipmentType1ID"]); this.EquipmentType1.Description = LookupManager.GetEquipmentClassDesc(this.EquipmentType1.Code, 1); } if (dr.Table.Columns.Contains("EquipmentType1ID")) { this.EquipmentType2.Code = SQLUtil.TrimNull(dr["EquipmentType2ID"]); this.EquipmentType2.Description = LookupManager.GetEquipmentClassDesc(this.EquipmentType2.Code, 2, this.EquipmentType1.Code); } this.Name = SQLUtil.TrimNull(dr["Name"]); this.Description = SQLUtil.TrimNull(dr["Description"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); if (dr.Table.Columns.Contains("FujiClass2Count")) { this.FujiClass2Count = SQLUtil.ConvertInt(dr["FujiClass2Count"]); } }
/// <summary> /// 修改耗材信息 /// </summary> /// <param name="info">耗材信息</param> /// <returns>耗材id</returns> public int UpdateConsumable(InvConsumableInfo info) { sqlStr = "UPDATE tblInvConsumable Set ConsumableID=@ConsumableID,LotNum=@LotNum,Specification=@Specification, " + " Model=@Model,SupplierID=@SupplierID,Price=@Price,ReceiveQty=@ReceiveQty,PurchaseDate=@PurchaseDate," + " PurchaseID=@PurchaseID,Comments=@Comments,AvaibleQty=@AvaibleQty,UpdateDate=GetDate() " + " WHERE ID = @ID"; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@ID", SqlDbType.Int).Value = info.ID; command.Parameters.Add("@ConsumableID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Consumable.ID); command.Parameters.Add("@LotNum", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.LotNum); command.Parameters.Add("@Specification", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Specification); command.Parameters.Add("@Model", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Model); command.Parameters.Add("@SupplierID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Supplier.ID); command.Parameters.Add("@Price", SqlDbType.Decimal).Value = info.Price; command.Parameters.Add("@ReceiveQty", SqlDbType.Decimal).Value = info.ReceiveQty; command.Parameters.Add("@PurchaseDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(info.PurchaseDate); command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = SQLUtil.ConvertInt(info.Purchase.ID); command.Parameters.Add("@AvaibleQty", SqlDbType.Decimal).Value = info.AvaibleQty; command.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(info.Comments); command.ExecuteNonQuery(); return(info.ID); } }
public ServiceHisInfo(DataRow dr) : this() { this.EquipmentID = SQLUtil.ConvertInt(dr["EquipmentID"]); this.TransDate = SQLUtil.ConvertDateTime(dr["TransDate"]); this.Income = SQLUtil.ConvertDouble(dr["Income"]); }
/// <summary> /// 获取验证信息 /// </summary> /// <param name="dr">The dr.</param> public VerificationCodeInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.MobilePhone = SQLUtil.TrimNull(dr["MobilePhone"]); this.VerificationCode = SQLUtil.TrimNull(dr["VerificationCode"]); this.CreatedTime = SQLUtil.ConvertDateTime(dr["CreatedTime"]); }
/// <summary> /// 获取广播信息 /// </summary> /// <param name="dr">The dr.</param> public NoticeInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Content = SQLUtil.TrimNull(dr["Content"]); this.Comments = SQLUtil.TrimNull(dr["Comments"]); this.IsLoop = SQLUtil.ConvertBoolean(dr["IsLoop"]); this.CreatedDate = SQLUtil.ConvertDateTime(dr["CreatedDate"]); }
public UserInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.IsAdmin = SQLUtil.ConvertBoolean(dr["IsAdmin"]); this.LoginID = SQLUtil.TrimNull(dr["LoginID"]); this.LoginPwd = SQLUtil.TrimNull(dr["LoginPwd"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Email = SQLUtil.TrimNull(dr["Email"]); this.CreatedDate = SQLUtil.ConvertDateTime(dr["CreatedDate"]); }
/// <summary> /// 服务库info /// </summary> /// <param name="dr">dr</param> public InvServiceInfo(DataRow dr) : this() { if (dr.Table.Columns.Contains("ID")) { this.ID = SQLUtil.ConvertInt(dr["ID"]); } this.FujiClass2.ID = SQLUtil.ConvertInt(dr["FujiClass2ID"]); if (dr.Table.Columns.Contains("FujiClass2Name")) { this.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); } this.Name = SQLUtil.TrimNull(dr["Name"]); this.TotalTimes = SQLUtil.ConvertInt(dr["TotalTimes"]); this.Price = SQLUtil.ConvertDouble(dr["Price"]); this.StartDate = SQLUtil.ConvertDateTime(dr["StartDate"]); this.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); if (dr.Table.Columns.Contains("SupplierID")) { this.Supplier.ID = SQLUtil.ConvertInt(dr["SupplierID"]); } if (dr.Table.Columns.Contains("SupplierName")) { this.Supplier.Name = SQLUtil.TrimNull(dr["SupplierName"]); } this.Purchase.ID = SQLUtil.ConvertInt(dr["PurchaseID"]); this.Purchase.Name = LookupManager.GetObjectOID(ObjectTypes.PurchaseOrder, this.Purchase.ID); if (dr.Table.Columns.Contains("PurchaseDate")) { this.PurchaseDate = SQLUtil.ConvertDateTime(dr["PurchaseDate"]); } if (dr.Table.Columns.Contains("Comments")) { this.Comments = SQLUtil.TrimNull(dr["Comments"]); } if (dr.Table.Columns.Contains("AddDate")) { this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); } if (dr.Table.Columns.Contains("AvaibleTimes")) { this.AvaibleTimes = SQLUtil.ConvertInt(dr["AvaibleTimes"]); } if (dr.Table.Columns.Contains("UpdateDate")) { this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); } if (dr.Table.Columns.Contains("Inbounded")) { this.Inbounded = SQLUtil.ConvertBoolean(dr["Inbounded"]); } }
public SupplierInfo(DataRow dr) : this() { this.SupplierType.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Province = SQLUtil.TrimNull(dr["State/City"]); this.Mobile = SQLUtil.TrimNull(dr["Phone"]); this.Address = SQLUtil.TrimNull(dr["Address"]); this.Contact = SQLUtil.TrimNull(dr["ContactPerson"]); this.ContactMobile = SQLUtil.TrimNull(dr["ContactPhone"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.IsActive = SQLUtil.ConvertBoolean(dr["Status"]); }
/// <summary> /// 获取自定义报表信息 /// </summary> /// <param name="dr">The dr.</param> public CustomReportInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.CreateUser.ID = SQLUtil.ConvertInt(dr["CreateUserID"]); this.CreateUser.Name = SQLUtil.TrimNull(dr["CreateUserName"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.CreatedDate = SQLUtil.ConvertDateTime(dr["CreatedDate"]); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); this.LastRunDate = SQLUtil.ConvertDateTime(dr["LastRunDate"]); this.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Type.Name = LookupManager.GetCustRptTypeDesc(this.Type.ID); }
/// <summary> /// 历史信息 /// </summary> /// <param name="dr">The dr.</param> public HistoryInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.ObjectID = SQLUtil.ConvertInt(dr["ObjectID"]); this.Operator.ID = SQLUtil.ConvertInt(dr["OperatorID"]); this.Operator.Name = this.Operator.ID == 0 ? "" : SQLUtil.TrimNull(dr["OperatorName"]); this.Operator.Role.ID = SQLUtil.ConvertInt(dr["OperatorRoleID"]); this.Operator.Role.Name = this.Operator.Role.ID == 0?"":LookupManager.GetRoleDesc(this.Operator.Role.ID); this.Action.ID = SQLUtil.ConvertInt(dr["Action"]); this.Comments = SQLUtil.TrimNull(dr["Comments"]); this.TransDate = SQLUtil.ConvertDateTime(dr["TransDate"]); }
/// <summary> /// 获取文件信息 /// </summary> /// <param name="dr">The dr.</param> public UploadFileInfo(DataRow dr) { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.ObjectTypeId = SQLUtil.ConvertInt(dr["ObjectTypeId"]); this.ObjectID = SQLUtil.ConvertInt(dr["ObjectID"]); this.FileName = SQLUtil.TrimNull(dr["FileName"]); this.FileDesc = SQLUtil.TrimNull(dr["FileDesc"]); this.FileType = SQLUtil.ConvertInt(dr["FileType"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.Seq = SQLUtil.ConvertInt(dr["Seq"]); SetDisplayFileName(); }
/// <summary> /// 科室下所有设备信息(包括收入、支出) /// </summary> /// <param name="id">科室编号</param> /// <param name="date">日期</param> /// <returns>科室下所有设备信息</returns> public List <EquipmentInfo> EquipmentsDetailsByDepartment(int id, string date = "") { int curYear = DateTime.Today.Year; if (!string.IsNullOrEmpty(date)) { curYear = SQLUtil.ConvertDateTime(date).Year; } int lastYear = curYear - 1; if (WebConfig.ISDEMO) { curYear = 2019; lastYear = 2018; } List <EquipmentInfo> equipmentInfos = this.equipmentDao.GetEquipmentsByDepartmentID(id); List <ServiceHisCountInfo> serviceInfosThisYear = this.serviceHisDao.GetServiceHisCountsByEquipment(curYear); List <ServiceHisCountInfo> accessoryExpensesThisYear = this.serviceHisDao.GetAccessoryExpenseByEquipment(curYear); List <ServiceHisCountInfo> serviceInfosLastYear = this.serviceHisDao.GetServiceHisCountsByEquipment(lastYear); List <ServiceHisCountInfo> accessoryExpensesLastYear = this.serviceHisDao.GetAccessoryExpenseByEquipment(lastYear); ServiceHisCountInfo serviceInfo = null; foreach (EquipmentInfo info in equipmentInfos) { serviceInfo = (from ServiceHisCountInfo temp in serviceInfosThisYear where temp.ObjectID == info.ID select temp).FirstOrDefault(); if (serviceInfo != null) { info.Incomes = serviceInfo.Incomes; } serviceInfo = (from ServiceHisCountInfo temp in accessoryExpensesThisYear where temp.ObjectID == info.ID select temp).FirstOrDefault(); if (serviceInfo != null) { info.Expenses = serviceInfo.Expenses; } serviceInfo = (from ServiceHisCountInfo temp in serviceInfosLastYear where temp.ObjectID == info.ID select temp).FirstOrDefault(); if (serviceInfo != null) { info.LastIncomes = serviceInfo.Incomes; } serviceInfo = (from ServiceHisCountInfo temp in accessoryExpensesLastYear where temp.ObjectID == info.ID select temp).FirstOrDefault(); if (serviceInfo != null) { info.LastExpenses = serviceInfo.Expenses; } } equipmentInfos.RemoveAll(t => ((t.EquipmentStatus.ID == EquipmentInfo.EquipmentStatuses.Scrap) && t.Incomes == 0 && t.Expenses == 0)); return(equipmentInfos); }
public ReportMaterialInfo(DataRow dr) : this() { this.DispatchReport.ID = SQLUtil.ConvertInt(dr["DispatchReportID"]); this.ObjectType.ID = SQLUtil.ConvertInt(dr["ObjectType"]); this.ObjectType.Name = LookupManager.GetObjectTypeDescription(this.ObjectType.ID); this.Object.ID = SQLUtil.ConvertInt(dr["ObjectID"]); this.Object.Name = SQLUtil.TrimNull(dr["ObjectName"]); this.Equipment.ID = SQLUtil.ConvertInt(dr["EquipmentID"]); this.Equipment.Name = SQLUtil.TrimNull(dr["EquipmentName"]); this.User.ID = SQLUtil.ConvertInt(dr["UserID"]); this.User.Name = SQLUtil.TrimNull(dr["UserName"]); this.Qty = SQLUtil.ConvertDouble(dr["Qty"]); this.UsedDate = SQLUtil.ConvertDateTime(dr["UsedDate"]); }
public DispatchInfo(DataRow dr) : this() { this.Request.ID = SQLUtil.ConvertInt(dr["RequestID"]); this.RequestType.ID = SQLUtil.ConvertInt(dr["RequestType"]); this.Urgency.ID = SQLUtil.ConvertInt(dr["EmergencyLevelID"]); this.MachineStatus.ID = SQLUtil.ConvertInt(dr["EquipmentStatusID"]); this.Engineer.ID = SQLUtil.ConvertInt(dr["EngineerID"]); this.ScheduleDate = SQLUtil.ConvertDateTime(dr["ScheduleDate"]); this.LeaderComments = SQLUtil.TrimNull(dr["Note"]); this.Status.ID = SQLUtil.ConvertInt(dr["DispatchStatusID"]); this.CreateDate = SQLUtil.ConvertDateTime(dr["CreateDate"]); this.StartDate = SQLUtil.ConvertDateTime(dr["StartDate"]); this.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); }
public ContractInfo(DataRow dr) : this() { this.ContractNum = SQLUtil.TrimNull(dr["Number"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Scope.ID = SQLUtil.ConvertInt(dr["ServiceScopeID"]); this.ScopeComments = SQLUtil.TrimNull(dr["ScopeComments"]); this.Amount = SQLUtil.ConvertDouble(dr["Amount"]); this.ProjectNum = SQLUtil.TrimNull(dr["ProjectNum"]); this.StartDate = SQLUtil.ConvertDateTime(dr["StartDate"]); this.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); this.Comments = SQLUtil.TrimNull(dr["Note"]); this.SupplierID = SQLUtil.ConvertInt(dr["SupplierID"]); }
/// <summary> /// 获取供应商信息 /// </summary> /// <param name="dr">The dr.</param> public SupplierInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.SupplierType.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.SupplierType.Name = Manager.LookupManager.GetSupplierTypeDesc(this.SupplierType.ID); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Province = SQLUtil.TrimNull(dr["Province"]); this.Mobile = SQLUtil.TrimNull(dr["Mobile"]); this.Address = SQLUtil.TrimNull(dr["Address"]); this.Contact = SQLUtil.TrimNull(dr["Contact"]); this.ContactMobile = SQLUtil.TrimNull(dr["ContactMobile"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.IsActive = SQLUtil.ConvertBoolean(dr["IsActive"]); }
/// <summary> /// 备用机库info /// </summary> /// <param name="dr">dr</param> public InvSpareInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.FujiClass2.ID = SQLUtil.ConvertInt(dr["FujiClass2ID"]); if (dr.Table.Columns.Contains("FujiClass2Name")) { this.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); } this.SerialCode = SQLUtil.TrimNull(dr["SerialCode"]); this.Price = SQLUtil.ConvertDouble(dr["Price"]); this.StartDate = SQLUtil.ConvertDateTime(dr["StartDate"]); this.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); }
/// <summary> /// 获取日志信息 /// </summary> /// <param name="dr">The dr.</param> public AuditHdrInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.TransUser.ID = SQLUtil.ConvertInt(dr["UserID"]); this.TransUser.LoginID = SQLUtil.TrimNull(dr["LoginID"]); this.TransUser.Name = SQLUtil.TrimNull(dr["Name"]); this.TransUser.Role.ID = SQLUtil.ConvertInt(dr["RoleID"]); this.TransUser.Role.Name = Manager.LookupManager.GetRoleDesc(this.TransUser.Role.ID); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); this.ObjectType.ID = SQLUtil.ConvertInt(dr["ObjectTypeID"]); this.ObjectType = LookupManager.GetObjectType(this.ObjectType.ID); this.ObjectID = SQLUtil.ConvertInt(dr["ObjectID"]); this.Operation.ID = SQLUtil.ConvertInt(dr["Operation"]); this.Operation.Name = AuditOperations.GetOperationName(this.Operation.ID); }
public EquipmentInfo(DataRow dr) : this() { this.EquipmentLevel.ID = SQLUtil.ConvertInt(dr["EquipmentLevel"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.EquipmentCode = SQLUtil.TrimNull(dr["Model"]); this.SerialCode = SQLUtil.TrimNull(dr["SerialNo#"]); this.ManufacturerID = SQLUtil.ConvertInt(dr["ManufacturerID"]); this.EquipmentClass1 = SQLUtil.ConvertInt(dr["EquipmentClass1"]); this.EquipmentClass2 = SQLUtil.ConvertInt(dr["EquipmentClass2"]); this.EquipmentClass3 = SQLUtil.ConvertInt(dr["EquipmentClass3"]); this.ResponseTimeLength = SQLUtil.ConvertInt(dr["StandardResponseTime(minutes)"]); this.FixedAsset = SQLUtil.ConvertBoolean(dr["FixedAsset"]); this.AssetCode = SQLUtil.TrimNull(dr["AssetNumber"]); this.AssetLevel.ID = SQLUtil.ConvertInt(dr["AssetClassID"]); this.DepreciationYears = SQLUtil.ConvertInt(dr["DepreciationYears"]); this.ValidityStartDate = SQLUtil.ConvertDateTime(dr["DurationofCertificateStartDate"]); this.ValidityEndDate = SQLUtil.ConvertDateTime(dr["DurationofCertificateEndDate"]); this.SaleContractName = SQLUtil.TrimNull(dr["SalesContract"]); this.SupplierID = SQLUtil.ConvertInt(dr["DealerID"]); this.PurchaseWay = SQLUtil.TrimNull(dr["PurchaseType"]); this.PurchaseAmount = SQLUtil.ConvertDouble(dr["PurchaseAmount"]); this.PurchaseDate = SQLUtil.ConvertDateTime(dr["PurchaseDate"]); this.IsImport = SQLUtil.ConvertBoolean(dr["ProductionDistrict"]); this.Department.ID = SQLUtil.ConvertInt(dr["DepartmentID"]); this.InstalSite = SQLUtil.TrimNull(dr["InstallationLocation"]); this.InstalStartDate = SQLUtil.ConvertDateTime(dr["InstalStartDate"]); this.InstalEndDate = SQLUtil.ConvertDateTime(dr["InstalEndDate"]); this.Accepted = SQLUtil.ConvertBoolean(dr["AcceptanceStatus"]); this.AcceptanceDate = SQLUtil.ConvertDateTime(dr["AcceptanceDate"]); this.UsageStatus.ID = SQLUtil.ConvertInt(dr["StatusofUse"]); this.EquipmentStatus.ID = SQLUtil.ConvertInt(dr["EquipmentStatusID"]); this.ScrapDate = SQLUtil.ConvertDateTime(dr["DisposalDate"]); this.MaintenancePeriod = SQLUtil.ConvertInt(dr["MaintenancePeriod"]); this.MaintenanceType.ID = SQLUtil.ConvertInt(dr["MaintenanceTypeID"]); this.PatrolPeriod = SQLUtil.ConvertInt(dr["PatrolPeriod"]); this.PatrolType.ID = SQLUtil.ConvertInt(dr["PatrolTypeID"]); this.CorrectionPeriod = SQLUtil.ConvertInt(dr["CalibrationPeriod"]); this.CorrectionType.ID = SQLUtil.ConvertInt(dr["CalibrationTypeID"]); this.MandatoryTestStatus.ID = SQLUtil.ConvertInt(dr["InspectionFlag"]); this.MandatoryTestDate = SQLUtil.ConvertDateTime(dr["InspectionDate"]); this.RecallFlag = SQLUtil.ConvertBoolean(dr["RecallFlag"]); this.RecallDate = SQLUtil.ConvertDateTime(dr["RecallDate"]); this.CreateDate = SQLUtil.ConvertDateTime(dr["CreateDate"]); this.CreateUserID = SQLUtil.ConvertInt(dr["CreateUserID"]); }
/// <summary> /// 添加采购单服务 /// </summary> /// <param name="purchaseOrderID">采购单id</param> /// <param name="serviceID">服务id</param> public void AddService(int purchaseOrderID, InvServiceInfo serviceInfo) { sqlStr = "INSERT INTO tblPurchaseService (PurchaseID,FujiClass2ID,Name,TotalTimes,Price,StartDate,EndDate) " + " VALUES(@PurchaseID,@FujiClass2ID,@Name,@TotalTimes,@Price,@StartDate,@EndDate); "; using (SqlCommand command = ConnectionUtil.GetCommand(sqlStr)) { command.Parameters.Add("@PurchaseID", SqlDbType.Int).Value = purchaseOrderID; command.Parameters.Add("@FujiClass2ID", SqlDbType.Int).Value = serviceInfo.FujiClass2.ID; command.Parameters.Add("@Name", SqlDbType.NVarChar).Value = SQLUtil.TrimNull(serviceInfo.Name); command.Parameters.Add("@TotalTimes", SqlDbType.Int).Value = serviceInfo.TotalTimes; command.Parameters.Add("@Price", SqlDbType.Decimal).Value = serviceInfo.Price; command.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(serviceInfo.StartDate); command.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = SQLUtil.ConvertDateTime(serviceInfo.EndDate); command.ExecuteNonQuery(); } }