Esempio n. 1
0
        public override int Validate()
        {
            var v = (int)NWorkorderValidationError.Validated;

            if (Convert.ToInt32(_row["woType"]) == (int)NWorkorderType.Production)
            {
                DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);
                //Should Handling no item error here
                double sum = 0;
                if (tbl != null)
                {
                    foreach (DataRow row in tbl.Rows)
                    {
                        sum += Convert.ToDouble(row["qiAmount"]);
                    }
                }

                if (sum == 0)
                {
                    v = (int)NWorkorderValidationError.ItemPriceSumEqualsToZero;
                }
            }

            return(v);
        }
Esempio n. 2
0
        public override int Validate()
        {
            var       v   = (int)NWorkorderValidationError.Validated;
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);
            //any item has a zero leadtie will cause the error

            int leadtime = 0;

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    if (!Convert.IsDBNull(row["Leadtime"]))
                    {
                        leadtime = MyConvert.ConvertToInteger(row["Leadtime"]);
                        if (leadtime == 0)
                        {
                            v = (int)NWorkorderValidationError.ItemLeadtimeRequired;
                            break;
                        }
                    }
                }
            }
            return(v);
        }
Esempio n. 3
0
 public WorkOrderSelect(string woNumber)
 {
     _row = WorkorderShared.GetWorkorderInfo(woNumber);
     if (_row != null)
     {
         _woID = Convert.ToInt32(_row["woID"]);
     }
 }
Esempio n. 4
0
        private int GetIsInstallto()
        {
            int     installToID = 0;
            DataRow row         = WorkorderShared.GetWorkorderInfo(_woID);

            installToID = Convert.ToInt32(row["Company1"]);
            return(installToID);
        }
        private bool GetChecklistApplicable()
        {
            bool b = false;

            if (_woID > 100)
            {
                DataRow row = WorkorderShared.GetWorkorderInfo(_woID);
                b = Convert.ToBoolean(row["ChecklistApplicable"]);
            }

            return(b);
        }
Esempio n. 6
0
        private void CopyItems()
        {
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            if (tbl == null)
            {
                return;
            }
            foreach (DataRow row in tbl.Rows)
            {
                int woItemID = Convert.ToInt32(row["woItemID"]);
                var wi       = new WorkorderItemCopy(_woID, _newWoID, woItemID);
                wi.Copy();
            }
        }
Esempio n. 7
0
        public bool isDeletable()
        {
            bool    b           = false;
            DataRow woTitleInfo = WorkorderShared.GetWorkorderInfo(_woID);

            if (woTitleInfo != null)
            {
                int woStatus = Convert.ToInt32(woTitleInfo["woStatus"]);
                if (woStatus == (int)NJobStatus.woNew | woStatus == (int)NJobStatus.woInvalid |
                    woStatus == (int)NJobStatus.woObsolete)
                {
                    b = true;
                }
            }
            return(b);
        }
Esempio n. 8
0
        private bool IsThisOrderRequireAddressAccordingToItem()
        {
            //55 Fabrication
            //80 Shipping
            //90 Pickup
            int[] NotRequiredItems =
            {
                55,
                80,
                90
            };

            bool      b   = true;
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            if (tbl != null)
            {
                bool b1 = false;

                foreach (DataRow Row in tbl.Rows)
                {
                    int  requirement = Convert.ToInt32(Row["requirement"]);
                    bool b2Contains  = false;
                    for (int i = 0; i <= NotRequiredItems.Length - 1; i++)
                    {
                        if (NotRequiredItems[i] == requirement)
                        {
                            b2Contains = true;
                            break; // TODO: might not be correct. Was : Exit For
                        }
                    }

                    if (!b2Contains)
                    {
                        b1 = true;
                        //Exit For
                    }
                }

                b = b1;
            }

            return(b);
        }
Esempio n. 9
0
        private bool isThereSpecialProcedure()
        {
            bool      b   = false;
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    int woItemID = Convert.ToInt32(row["woItemID"]);
                    if (isThereSpecialProcedureOfThisWoIte(woItemID))
                    {
                        b = true;
                        break; // TODO: might not be correct. Was : Exit For
                    }
                }
            }
            return(b);
        }
Esempio n. 10
0
        private int GetMaxPrintOrderOfItems()
        {
            int       maxValue = 0;
            DataTable children = WorkorderShared.getExistingWorkorderItems(_woID);

            if (children == null)
            {
                return(maxValue);
            }

            foreach (DataRow row in children.Rows)
            {
                int i = Convert.ToInt32(row["woPrintOrder"]);
                if (i > maxValue)
                {
                    maxValue = i;
                }
            }
            return(maxValue);
        }
Esempio n. 11
0
        private bool IsThisRequirementExist(int requirement)
        {
            bool b = false;

            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    if (requirement == Convert.ToInt32(row["requirement"]))
                    {
                        b = true;
                        break; // TODO: might not be correct. Was : Exit For
                    }
                }
            }

            return(b);
        }
Esempio n. 12
0
        public void delete()
        {
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    var wi = new WorkorderItemDelete(Convert.ToInt32(row["woItemID"]));
                    wi.Delete();
                }
            }

            ReleaseRegisteredWorkorderNumber();

            var wda = new WorkorderDeleteAccessary(_woID);

            wda.Delete();

            DeleteWorkorderTitle();
        }
Esempio n. 13
0
        public override int Validate()
        {
            var       v   = (int)NWorkorderValidationError.Validated;
            DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID);

            //Should Handling no item error here
            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    string itemName = Convert.ToString(row["estItemNameText"]);
                    if (itemName == "New Item")
                    {
                        v = (int)NWorkorderValidationError.ItemNameRequired;
                        break; //
                    }
                }
            }

            return(v);
        }
Esempio n. 14
0
 public WorkorderValidationItem(int woID, int itemValidationNo)
 {
     _row              = WorkorderShared.GetWorkorderInfo(woID);
     _woID             = woID;
     _itemValidationNo = itemValidationNo;
 }
Esempio n. 15
0
 public WorkOrderSelect(int woID)
 {
     _woID = woID;
     _row  = WorkorderShared.GetWorkorderInfo(_woID);
 }
Esempio n. 16
0
 public WorkorderChangeType(int woID, int woType)
 {
     _woID    = woID;
     _woType  = woType;
     _itemTbl = WorkorderShared.getExistingWorkorderItems(woID);
 }
Esempio n. 17
0
 public WorkorderValidationItem(int woID)
 {
     _row  = WorkorderShared.GetWorkorderInfo(woID);
     _woID = woID;
 }