public BatchLabourDetails Get(long LabourActID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@LabourRecID", LabourActID)
                };

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

                BatchLabourDetails obj = new BatchLabourDetails();
                BatchActivity_DL   objBatchActivity_DL = new BatchActivity_DL(ConnectionStringClass.GetConnection());
                Employee_DL        objEmployee_DL      = new Employee_DL(ConnectionStringClass.GetConnection());

                if (dt.Rows.Count != 0)
                {
                    obj.BatchAct       = objBatchActivity_DL.GetByID(Convert.ToInt32(dt.Rows[0]["BatchActID"]));
                    obj.Emp            = objEmployee_DL.Get(Convert.ToString(dt.Rows[0]["EmployeeID"]));
                    obj.HourlyRate     = Convert.ToDecimal(dt.Rows[0]["HourlyRate"]);
                    obj.LabourRecID    = Convert.ToInt32(dt.Rows[0]["LabourRecID"]);
                    obj.OTHours        = Convert.ToDecimal(dt.Rows[0]["OTHours"]);
                    obj.OTRate         = Convert.ToDecimal(dt.Rows[0]["OTRate"]);
                    obj.WorkStart_Date = Convert.ToDateTime(dt.Rows[0]["WorkStart"]);
                    obj.WorkStop_Date  = Convert.ToDateTime(dt.Rows[0]["WorkStop"]);
                }



                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemple #2
0
        public MaterialCollec Get(string MatMainType, string MatCategory)
        {
            try
            {
                Material_DL objMaterial_DL = new Material_DL(ConnectionStringClass.GetConnection());

                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@MatMainType", MatMainType),
                    new SqlParameter("@MatMainCategory", MatCategory)
                };



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

                MaterialCollec objMatCollec = new MaterialCollec();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Material objMaterial = new Material();
                    objMaterial.IsExport   = Convert.ToBoolean(dt.Rows[i]["Export"]);
                    objMaterial.IsLocal    = Convert.ToBoolean(dt.Rows[i]["Local"]);
                    objMaterial.IsSeasanal = Convert.ToBoolean(dt.Rows[i]["Seasanal"]);
                    if (dt.Rows[i]["BasicMaterialCode"] != dt.Rows[i]["MaterialCode"])
                    {
                        objMaterial.MatBasicMaterial = dt.Rows[i]["BasicMaterialCode"].ToString();
                    }

                    objMaterial.MatBasicQty = Convert.ToDecimal(dt.Rows[i]["BasicQty"]);
                    objMaterial.MatCost     = Convert.ToDecimal(dt.Rows[i]["AVGCost"]);
                    objMaterial.MateialType = objMaterialType_DL.Get(Convert.ToString(dt.Rows[i]["MatTypeID"]));

                    objMaterial.MaterialMainType    = Convert.ToString(dt.Rows[i]["MatMainType"]);
                    objMaterial.MaterialCode        = Convert.ToString(dt.Rows[i]["MaterialCode"]);
                    objMaterial.MaterialDescription = Convert.ToString(dt.Rows[i]["MaterialDescription"]);
                    objMaterial.MaterialStatus      = Convert.ToInt32(dt.Rows[i]["Status"]);
                    objMaterial.MaterialCategory    = Convert.ToString(dt.Rows[i]["MatCatID"]);
                    objMaterial.MatForm             = objForm_DL.Get(Convert.ToInt64(dt.Rows[i]["ItemFormID"]));
                    objMaterial.MatParticleSize     = Convert.ToString(dt.Rows[i]["ParticalSize"]);
                    objMaterial.MatSeasonFrom       = Convert.ToString(dt.Rows[i]["SeasanFrom"]);
                    objMaterial.MatSeasonTo         = Convert.ToString(dt.Rows[i]["SeasanTo"]);
                    objMaterial.MatUnit             = objUnit_DL.Get(Convert.ToInt64(dt.Rows[i]["UnitID"]));



                    objMatCollec.Add(objMaterial);
                }


                return(objMatCollec);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemple #3
0
        public Material GetDryMaterial(String BasicMaterialCode)
        {
            try
            {
                Material_DL objMaterial_DL = new Material_DL(ConnectionStringClass.GetConnection());

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

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

                Material objMaterial = new Material();

                if (dt.Rows.Count > 0)
                {
                    objMaterial.IsExport   = Convert.ToBoolean(dt.Rows[0]["Export"]);
                    objMaterial.IsLocal    = Convert.ToBoolean(dt.Rows[0]["Local"]);
                    objMaterial.IsSeasanal = Convert.ToBoolean(dt.Rows[0]["Seasanal"]);
                    if (dt.Rows[0]["BasicMaterialCode"] != dt.Rows[0]["MaterialCode"])
                    {
                        objMaterial.MatBasicMaterial = dt.Rows[0]["BasicMaterialCode"].ToString();
                    }

                    objMaterial.MatBasicQty = Convert.ToDecimal(dt.Rows[0]["BasicQty"]);
                    objMaterial.MatCost     = Convert.ToDecimal(dt.Rows[0]["AVGCost"]);
                    objMaterial.MateialType = objMaterialType_DL.Get(Convert.ToString(dt.Rows[0]["MatType"]));

                    objMaterial.MaterialMainType    = Convert.ToString(dt.Rows[0]["MatMainType"]);
                    objMaterial.MaterialCode        = Convert.ToString(dt.Rows[0]["MaterialCode"]);
                    objMaterial.MaterialDescription = Convert.ToString(dt.Rows[0]["MaterialDescription"]);
                    objMaterial.MaterialStatus      = Convert.ToInt32(dt.Rows[0]["Status"]);
                    objMaterial.MaterialCategory    = Convert.ToString(dt.Rows[0]["MatCatID"]);
                    objMaterial.MatForm             = objForm_DL.Get(Convert.ToInt64(dt.Rows[0]["FormID"]));
                    objMaterial.MatParticleSize     = Convert.ToString(dt.Rows[0]["ParticalSize"]);
                    objMaterial.MatSeasonFrom       = Convert.ToString(dt.Rows[0]["SeasanFrom"]);
                    objMaterial.MatSeasonTo         = Convert.ToString(dt.Rows[0]["SeasanTo"]);
                    objMaterial.MatUnit             = objUnit_DL.Get(Convert.ToInt64(dt.Rows[0]["UnitID"]));
                    objMaterial.MaterialCategory    = Convert.ToString(dt.Rows[0]["UnitID"]);
                }

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