예제 #1
0
파일: PO_DL.cs 프로젝트: lulzzz/LinkMRP
        public PO Get(String PONO)
        {
            try
            {
                DataTable dt    = new DataTable();
                PO        objPO = new PO();

                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@PONO", PONO)
                };

                dt = Execute.RunSP_DataTable(Connection, "SPGET_PO_ByID", paramList);


                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["POApporvedBy"] != DBNull.Value)
                    {
                        objPO.POApporvedBy = Convert.ToString(dt.Rows[0]["POApporvedBy"]);
                    }
                    if (dt.Rows[0]["POApprovedDate"] != DBNull.Value)
                    {
                        objPO.POApprovedDate = Convert.ToDateTime(dt.Rows[0]["POApprovedDate"]);
                    }
                    if (dt.Rows[0]["POChangedApprove"] != DBNull.Value)
                    {
                        objPO.POChangedApprove = Convert.ToString(dt.Rows[0]["POChangedApprove"]);
                    }
                    if (dt.Rows[0]["POChangedApprovedDate"] != DBNull.Value)
                    {
                        objPO.POChangedApprovedDate = Convert.ToDateTime(dt.Rows[0]["POChangedApprovedDate"]);
                    }
                    if (dt.Rows[0]["POChangedBy"] != DBNull.Value)
                    {
                        objPO.POChangedBy = Convert.ToString(dt.Rows[0]["POChangedBy"]);
                    }
                    if (dt.Rows[0]["POChangedDate"] != DBNull.Value)
                    {
                        objPO.POChangedDate = Convert.ToDateTime(dt.Rows[0]["POChangedDate"]);
                    }
                    if (dt.Rows[0]["POChangedRemarks"] != DBNull.Value)
                    {
                        objPO.POChangedRemarks = Convert.ToString(dt.Rows[0]["POChangedRemarks"]);
                    }
                    if (dt.Rows[0]["PODate"] != DBNull.Value)
                    {
                        objPO.PODate = Convert.ToDateTime(dt.Rows[0]["PODate"]);
                    }
                    objPO.POEnterdBy    = Convert.ToString(dt.Rows[0]["POEnterdBy"]);
                    objPO.POEnterdDate  = Convert.ToDateTime(dt.Rows[0]["POEnterdDate"]);
                    objPO.PONO          = Convert.ToString(dt.Rows[0]["PONO"]);
                    objPO.POPaymentType = Convert.ToString(dt.Rows[0]["POPaymentType"]);
                    if (dt.Rows[0]["POReference"] != DBNull.Value)
                    {
                        objPO.POReference = Convert.ToString(dt.Rows[0]["POReference"]);
                    }
                    objPO.PORequiredDate = Convert.ToDateTime(dt.Rows[0]["PORequiredDate"]);
                    objPO.POStatus       = Convert.ToInt32(dt.Rows[0]["POStatus"]);
                    objPO.POSupplierID   = Convert.ToInt32(dt.Rows[0]["POSupplierID"]);
                    if (dt.Rows[0]["POSupplierID"] != DBNull.Value)
                    {
                        objPO.POValidityPeriod = Convert.ToInt32(dt.Rows[0]["POValidityPeriod"]);
                    }
                }

                return(objPO);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
예제 #2
0
        public STDBatch Get(string STDBatchID)
        {
            BasicProduct_DL  objBasicProductDL  = new BasicProduct_DL(Connection);
            FinishProduct_DL objFinishProductDL = new FinishProduct_DL(Connection);
            STDBatch         objSTDBatch        = new STDBatch();
            Employee_DL      objEmpDL           = new Employee_DL(Connection);


            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@STDBatchID", STDBatchID)
                };

                STDBatch obj = new STDBatch();

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_STDBatch_By_ID", paramList);

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["STDBatchID"] != null)
                    {
                        obj.STDBatchID = Convert.ToString(dt.Rows[0]["STDBatchID"]);
                    }

                    if (dt.Rows[0]["STDBatchDescription"] != null)
                    {
                        obj.STDBatchDescription = Convert.ToString(dt.Rows[0]["STDBatchDescription"]);
                    }

                    if (dt.Rows[0]["STDBasicProductCode"] != null)
                    {
                        obj.STDBatchBasicProduct = objBasicProductDL.Get(Convert.ToString(dt.Rows[0]["STDBasicProductCode"]));
                    }

                    if (dt.Rows[0]["STDFinishProductCode"] != null)
                    {
                        obj.STDBatchFinishProduct = objFinishProductDL.Get(Convert.ToString(dt.Rows[0]["STDFinishProductCode"]));
                    }

                    obj.STDBatchSize         = Convert.ToDecimal(dt.Rows[0]["STDBatchSize"]);
                    obj.STDBatchInstructedBy = objEmpDL.Get(Convert.ToString(dt.Rows[0]["STDInstructedBy"]));
                    obj.STDInstructedDate    = Convert.ToDateTime(dt.Rows[0]["STDInstructedDate"]);


                    obj.STDBatchType  = Convert.ToString(dt.Rows[0]["STDBatchType"]);
                    obj.STDDuration   = Convert.ToDecimal(dt.Rows[0]["STDDuration"]);
                    obj.EditableBatch = Convert.ToBoolean(dt.Rows[0]["EditableBatch"]);
                    obj.LabourHours   = Convert.ToDecimal(dt.Rows[0]["LabourHours"]);
                    obj.MachineHours  = Convert.ToDecimal(dt.Rows[0]["MachineHours"]);
                    obj.InputQty      = Convert.ToDecimal(dt.Rows[0]["InputQty"]);
                    obj.OutputQty     = Convert.ToDecimal(dt.Rows[0]["OutputQty"]);

                    if (dt.Rows[0]["SpecificGravity"] != DBNull.Value)
                    {
                        obj.SpecificGravity = Convert.ToBoolean(dt.Rows[0]["SpecificGravity"]);
                    }

                    if (dt.Rows[0]["Water"] != DBNull.Value)
                    {
                        obj.Water = Convert.ToDecimal(dt.Rows[0]["Water"]);
                    }
                }


                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
예제 #3
0
        public PRPDBatchActivityDetails.PRPDBatchActivityDetailsCollc Get()
       {

           try
           {

               DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_PRPDBatchActivityDetails");

               PRPDBatchCollec objCollec = new PRPDBatchCollec();
               PRPDBatch obj = new PRPDBatch();

               if (dt.Rows.Count > 0)
               {
                   for (int i = 0; i < dt.Rows.Count; i++)
                   {


                       obj.PRPDBatchID = Convert.ToString(dt.Rows[i]["PRPDBatchID"]);
                       obj.PRPDBatchSuperviser = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchSuperviserID"]));
                       obj.PRPDBatchMaterial = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchMaterialCode"]));
                       obj.PRPDBatchQty = Convert.ToDecimal(dt.Rows[i]["PRPDBatchQty"]);
                       obj.PRPDBatchInstructedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchInstructedBy"]));
                       obj.PRPDBatchInstructedDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchInstructedDate"]);
                       obj.PRPDBatchStartedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchStartedBy"]));
                       obj.PRPDBatchStartDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchStartDate"]);
                       obj.PRPDBatchApprovedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchApprovedBy"]));
                       obj.PRPDBatchApprovedDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchApprovedDate"]);
                       obj.PRPDBatchEndBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchEndBy"]));
                       obj.PRPDBatchEndDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchEndDate"]);
                       obj.Status = (PRPDBatch.PRPDBatchStatus)Enum.Parse(typeof(PRPDBatch.PRPDBatchStatus),Convert.ToString(dt.Rows[i]["PRPDBatchStatus"]);
                       obj.PRPDBatchMTNIN = Convert.ToInt64(dt.Rows[i]["MTNIN"]);
                       obj.PRPDBatchMTNOUT = objMTN_DL.Get(Convert.ToInt32(dt.Rows[i]["MTNOUT"]));
                       obj.UnitCost = Convert.ToDecimal(dt.Rows[i]["UnitCost"]);
                       obj.PRPDBatchInspectedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["InspectedBy"]));
                       obj.PRPDBatchInspectedDate = Convert.ToDateTime(dt.Rows[i]["InspectedDate"]);
                       obj.PRPDBatchHandOverBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["HandOverBy"]));
                       obj.PRPDBatchHandOverDate = Convert.ToDateTime(dt.Rows[i]["HandOverDate"]);
                       obj.PRPDBatchFinalQty = Convert.ToDecimal(dt.Rows[i]["FinalQty"]);
                       obj.PRPDSampleSize = Convert.ToString(dt.Rows[i]["SampleSize"]);
                       obj.PRPDBatchComments = Convert.ToString(dt.Rows[i]["Comments"]);
                       obj.Type = (PRPDBatch.PRPDType) Convert.ToInt64(dt.Rows[i]["BatchType"]);
                       obj.PRPDBatchTotalImpurities = Convert.ToDecimal(dt.Rows[i]["TotalImpurities"]);
                       obj.PRPDCAPID = Convert.ToDecimal(dt.Rows[i]["PRPDCAPID"]);
                       obj.MRIN = Convert.ToInt64(dt.Rows[i]["MRIN"]);
                       obj.PRPDBatchMaterialName = Convert.ToString(dt.Rows[i]["MaterialDescription"]);
                       obj.OutSourceQty = Convert.ToDecimal(dt.Rows[i]["OutSourceQty"]);

                       objCollec.Add(obj);
                   }
               }

               return objCollec;


           }
           catch (Exception ex)
           {

               throw new Exception(ex.Message, ex);
           }
       }
예제 #4
0
        public BatchActivity GetByID(int BatchActID)
        {
            BatchActivity   objBatchActivity   = new BatchActivity();
            Batch_DL        objBatch_DL        = new Batch_DL(Connection);
            Employee_DL     objEmployee_DL     = new Employee_DL(Connection);
            MainActivity_DL objMainActivity_DL = new MainActivity_DL(Connection);


            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@BatchActID", BatchActID)
                };

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_BatchActivity_By_ID", paramList);

                if (dt.Rows.Count != 0)
                {
                    objBatchActivity.MainActivity = objMainActivity_DL.Get(Convert.ToInt64(dt.Rows[0]["ActID"]));
                    objBatchActivity.BatchActID   = Convert.ToInt64(dt.Rows[0]["BatchActID"]);
                    objBatchActivity.Batch        = objBatch_DL.Get(dt.Rows[0]["BatchID"].ToString());

                    if (dt.Rows[0]["BatchActStatus"] != DBNull.Value)
                    {
                        objBatchActivity.BatchActStatus = (BatchActivity.Status)dt.Rows[0]["BatchActStatus"];
                    }

                    if (dt.Rows[0]["SequenceNo"] != DBNull.Value)
                    {
                        objBatchActivity.SequenceNo = Convert.ToInt32(dt.Rows[0]["SequenceNo"]);
                    }
                    objBatchActivity.Part = dt.Rows[0]["Part"].ToString();

                    objBatchActivity.LastEdited        = Convert.ToDateTime(dt.Rows[0]["LastEdited"]);
                    objBatchActivity.BlockNextActivity = Convert.ToBoolean(dt.Rows[0]["BlockNextActivity"]);

                    if (dt.Rows[0]["StartQty"] != DBNull.Value)
                    {
                        objBatchActivity.StartQty = Convert.ToDecimal(dt.Rows[0]["StartQty"]);
                    }

                    if (dt.Rows[0]["StopQty"] != DBNull.Value)
                    {
                        objBatchActivity.StopQty = Convert.ToDecimal(dt.Rows[0]["StopQty"]);
                    }
                    if (dt.Rows[0]["SupervisedBy"] != DBNull.Value)
                    {
                        objBatchActivity.SupervisedBy = objEmployee_DL.Get(dt.Rows[0]["SupervisedBy"].ToString());
                    }

                    if (dt.Rows[0]["StartProductCode"] != DBNull.Value)
                    {
                        objBatchActivity.StartProductCode = dt.Rows[0]["StartProductCode"].ToString();
                    }

                    if (dt.Rows[0]["EndProductCode"] != DBNull.Value)
                    {
                        objBatchActivity.EndProductCode = dt.Rows[0]["EndProductCode"].ToString();
                    }

                    objBatchActivity.ActType = dt.Rows[0]["ActType"].ToString();

                    if (dt.Rows[0]["ActMethod"] != DBNull.Value)
                    {
                        objBatchActivity.ActMethod = dt.Rows[0]["ActMethod"].ToString();
                    }
                }

                return(objBatchActivity);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }