internal void UpdateData(DataRow row) { row.ItemArray = new object[] { (IsNewItem) ? null : (object)Id, Code ?? string.Empty, Text ?? string.Empty, Count, FinalCount, ReceiveDate.ToString(), EstimatedDate.ToString(), TerminationDate.ToString(), Status }; }
public string InsertSQL() { String sql = "insert into workorder (productorder,type,scheduledate,lenth,width," + "thickness,gross,done,undone,completedate,machinecode,worker,worth,remark,status,receivedate,grosswidth) " + "values ('{0}','{1}','{2}',{3},{4},{5},{6},{7},{8},'{9}','{10}','{11}',{12},'{13}',{14},'{15}',{16})"; return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(), Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"), MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"), GrossWidth.ToString())); }
public string UndateSQL() { String sql = "update workorder set productorder = '{0}',type = '{1}',scheduledate='{2}',lenth={3},width = {4}," + "thickness={5},gross={6},done={7},undone={8},completedate='{9}',machinecode='{10}',worker='{11}'," + "worth={12},remark='{13}',status={14} ,receivedate = '{15}',grosswidth = {16} where id = {17} "; return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(), Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"), MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"), GrossWidth.ToString(), id.ToString())); }
//centralize format //adding new field guide //add new column in Query viewer //add new added element to ToArray respected to its column index in QueryViewer //update editor acordingly public string[] ToArray(bool skipErorrMessage = true) { return(new string[] { Id.ToString(), ADName, ResignDay.ToString("dd/MM/yyyy hh:mm:ss tt"), HRCode, ReceiveDate.ToString("dd/MM/yyyy hh:mm:ss tt"), Status.ToString(), Manager, skipErorrMessage? null : ErrorMessage }); }