コード例 #1
0
 private static void AddDeletedRecieveDocs(DataRow recieve)
 {
     var recd = new ReceiveDocDeleted();
     recd.AddNew();
     recd.ID = (int)recieve["ID"];
     recd.BatchNo = (string)recieve["BatchNo"];
     recd.ItemID = (int)recieve["ItemID"];
     recd.SupplierID = (int)recieve["SupplierID"];
     recd.Quantity = Convert.ToInt64(recieve["Quantity"]);
     recd.Date = (DateTime)recieve["Date"];
     recd.ExpDate = (DateTime)recieve["ExpDate"];
     recd.Out = (bool)recieve["Out"];
     // recd.ReceivedStatus = (int) recieve["ReceivedStatus"];
     // recd.ReceivedBy = (string) recieve["ReceivedBy"];
     //recd.Remark = (string)recieve["Remark"];
     recd.StoreID = (int)recieve["StoreID"];
     recd.LocalBatchNo = (string)recieve["LocalBatchNo"];
     recd.RefNo = (string)recieve["RefNo"];
     recd.Cost = (double)recieve["Cost"];
     recd.IsApproved = (bool)recieve["IsApproved"];
     // recd.ManufacturerId = (int) recieve["ManufacturerId"];
     recd.QuantityLeft = (long)recieve["QuantityLeft"];
     recd.NoOfPack = (int)recieve["NoOfPack"];
     recd.QtyPerPack = (int)recieve["QtyPerPack"];
     // recd.BoxLevel = (int) recieve["BoxLevel"];
     recd.EurDate = (DateTime)recieve["EurDate"];
     // recd.SubProgramID = (int) recieve["SubProgramID"];
     recd.Save();
 }
        private void gridOrderListView_FocusedRowChanged(object sender,
                                                         DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            DataRow dr = gridOrderListView.GetFocusedDataRow();
            if (dr != null)
            {
                int receiptID = Convert.ToInt32(dr["ID"]);
                ReceiveDoc receiveDoc = new ReceiveDoc();
                receiveDoc.LoadAllByReceiptID(receiptID);
                DataTable tbl = receiveDoc.DefaultView.ToTable();
                ReceiveDocDeleted receiveDocDeleted = new ReceiveDocDeleted();
                receiveDocDeleted.LoadAllByReceiptID(receiptID);

                LogReceiptStatus logReceiptStatus = new LogReceiptStatus();
                gridHistory.DataSource = logReceiptStatus.GetLogHistory(receiptID);

                if (receiveDocDeleted.RowCount > 0)
                {
                    tbl.Merge(receiveDocDeleted.DefaultView.ToTable());
                    BLL.User user = new User();
                    user.LoadByPrimaryKey(receiveDocDeleted.DeletedBy);
                    if (user.RowCount > 0)
                    {
                        lblDeletedBy.Text = string.Format("Deleted By {0}",
                                                          string.IsNullOrEmpty(user.FullName)
                                                              ? user.UserName
                                                              : user.FullName);
                    }
                }

                gridOrderDetail.DataSource = tbl;
            }
        }
        /// <summary>
        /// Adds a new delete log
        /// </summary>
        /// <param name="deletedReceiveDoc">The ReceiveDoc object to be deleted</param>
        /// <param name="deletedByUser">The user performing the deletion</param>
        public static ReceiveDocDeleted AddNewLog(ReceiveDoc deletedReceiveDoc, int deletedByUser)
        {
            var recLog = new ReceiveDocDeleted();
            recLog.AddNew();
            foreach (DataColumn col in deletedReceiveDoc.DefaultView.Table.Columns)
            {
                try
                {
                    recLog.SetColumn(col.ColumnName, deletedReceiveDoc.GetColumn(col.ColumnName));
                }
                catch { /*Till VVMID Column generated for ReceiveDocDeleted! */}

            }

            recLog.DeletedBy = deletedByUser;
            recLog.DateDeleted = DateTimeHelper.ServerDateTime;
            return recLog;
        }
コード例 #4
0
        /// <summary>
        /// Adds a new delete log
        /// </summary>
        /// <param name="deletedReceiveDoc">The ReceiveDoc object to be deleted</param>
        /// <param name="deletedByUser">The user performing the deletion</param>
        public static ReceiveDocDeleted AddNewLog(ReceiveDoc deletedReceiveDoc, int deletedByUser)
        {
            var recLog = new ReceiveDocDeleted();

            recLog.AddNew();
            foreach (DataColumn col in deletedReceiveDoc.DefaultView.Table.Columns)
            {
                try
                {
                    recLog.SetColumn(col.ColumnName, deletedReceiveDoc.GetColumn(col.ColumnName));
                }
                catch { /*Till VVMID Column generated for ReceiveDocDeleted! */ }
            }

            recLog.DeletedBy   = deletedByUser;
            recLog.DateDeleted = DateTimeHelper.ServerDateTime;
            return(recLog);
        }
コード例 #5
0
 private static void AddReceiveDocDeleted(DataRow dataRow)
 {
     var recd = new ReceiveDocDeleted();
     recd.AddNew();
     recd.ID = (int)dataRow["ID"];
     recd.BatchNo = (string)dataRow["BatchNo"];
     recd.ItemID = (int)dataRow["ItemID"];
     recd.SupplierID = (int)dataRow["SupplierID"];
     recd.Quantity = (long)dataRow["Quantity"];
     recd.Date = (DateTime)dataRow["Date"];
     recd.ExpDate = (DateTime)dataRow["ExpDate"];
     recd.Out = (bool)dataRow["Out"];
     recd.StoreID = (int)dataRow["StoreID"];
     recd.LocalBatchNo = (string)dataRow["LocalBatchNo"];
     recd.RefNo = (string)dataRow["RefNo"];
     recd.Cost = (double)dataRow["Cost"];
     recd.IsApproved = (bool)dataRow["IsApproved"];
     recd.QuantityLeft = (long)dataRow["QuantityLeft"];
     recd.NoOfPack = (int)dataRow["NoOfPack"];
     recd.QtyPerPack = (int)dataRow["QtyPerPack"];
     recd.EurDate = (DateTime)dataRow["EurDate"];
     recd.Save();
 }