예제 #1
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            int          actionResult = 0;
            EfficencyBLL effi         = new EfficencyBLL();

            try
            {
                if (Id > 0)
                {
                    actionResult = effi.DeleteEfficencyInfo(Id);
                    if (actionResult > 0)
                    {
                        massageLabel.Text = "successfully information deleted !!!";
                        LoadEfficencyInformation();
                    }
                    else
                    {
                        massageLabel.Text = "Delete Operation Failed !!!";
                    }
                }
                else
                {
                    massageLabel.Text = "Please do not force to delete information !!!";
                    LoadEfficencyInformation();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void excellButton_Click(object sender, EventArgs e)
        {
            fromDate = Convert.ToString(Convert.ToDateTime(fromDateTimePicker.Text).ToShortDateString());
            toDate   = Convert.ToString(Convert.ToDateTime(toDateTimePicker.Text).ToShortDateString());
            Plant    = plantComboBox.SelectedItem.ToString();

            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();

            dt = efficency.GetBuyerWiseProduction(fromDate, toDate, Plant);
            dataBind.DataSource = dt;
            buyerWisedataGridView.DataSource = dataBind;

            if (buyerWisedataGridView.Rows.Count > 0)
            {
                try
                {
                    // Bind table data to Stream Writer to export data to respective folder
                    StreamWriter wr = new StreamWriter(@"E:\\Buyer_Wise_Repports.xls");
                    wr.Write("HIRDARAMANI APPARELS BANGLADESH");
                    wr.WriteLine();
                    wr.Write("BUYER WISE SAMPLE SUMMERY");
                    wr.WriteLine();
                    wr.WriteLine();
                    wr.WriteLine();



                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        wr.Write(dt.Columns[i].ToString().ToUpper() + "\t");
                    }
                    wr.WriteLine();
                    for (int i = 0; i < (dt.Rows.Count); i++)
                    {
                        for (int j = 0; j < dt.Columns.Count; j++)
                        {
                            if (dt.Rows[i][j] != null)
                            {
                                wr.Write(Convert.ToString(dt.Rows[i][j]) + "\t");
                            }
                            else
                            {
                                wr.Write("\t");
                            }
                        }
                        wr.WriteLine();
                    }
                    wr.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #3
0
        private void excellButton_Click(object sender, EventArgs e)
        {
            fromDate = Convert.ToString(Convert.ToDateTime(fromDateTimePicker.Text).ToShortDateString());
            toDate   = Convert.ToString(Convert.ToDateTime(toDateTimePicker.Text).ToShortDateString());

            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();

            dt = efficency.GetItemCategoryWiseReport(fromDate, toDate, Plant);
            dataBind.DataSource             = dt;
            ItemWisedataGridView.DataSource = dataBind;


            if (ItemWisedataGridView.Rows.Count > 0)
            {
                try
                {
                    // Bind table data to Stream Writer to export data to respective folder
                    StreamWriter wr = new StreamWriter(@"E:\\Item_Wise_Repports.xls");
                    wr.Write("HIRDARAMANI APPARELS BANGLADESH");
                    wr.WriteLine();
                    wr.Write("Item wise sample summery");
                    wr.WriteLine();
                    wr.WriteLine();
                    wr.WriteLine();
                    // Write Columns to excel file
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        wr.Write(dt.Columns[i].ToString().ToUpper() + "\t");
                    }
                    wr.WriteLine();
                    //write rows to excel file
                    for (int i = 0; i < (dt.Rows.Count); i++)
                    {
                        for (int j = 0; j < dt.Columns.Count; j++)
                        {
                            if (dt.Rows[i][j] != null)
                            {
                                wr.Write(Convert.ToString(dt.Rows[i][j]) + "\t");
                            }
                            else
                            {
                                wr.Write("\t");
                            }
                        }
                        wr.WriteLine();
                    }
                    wr.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        private void SampleCostExcelbutton_Click(object sender, EventArgs e)
        {
            fromDate = Convert.ToString(Convert.ToDateTime(fromDateTimePicker.Text).ToShortDateString());
            toDate   = Convert.ToString(Convert.ToDateTime(toDateTimePicker.Text).ToShortDateString());

            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();

            dt = efficency.SampleCostBrakeDownSummeryReport(fromDate, toDate, materialCostR1, overHeadCostR1, materialCostK2, overHeadCostK2, planCpm);
            dataBind.DataSource = dt;
            sampleCostDataGridView.DataSource = dataBind;

            if (sampleCostDataGridView.Rows.Count > 0)
            {
                try
                {
                    // Bind table data to Stream Writer to export data to respective folder
                    StreamWriter wr = new StreamWriter(@"E:\\SampleWise_BrakeDown_Repports.xls");
                    wr.Write("HIRDARAMANI APPARELS BANGLADESH");
                    wr.WriteLine();
                    wr.Write("Unit Cost Status");
                    wr.WriteLine();
                    wr.WriteLine();
                    wr.WriteLine();
                    // Write Columns to excel file
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        wr.Write(dt.Columns[i].ToString().ToUpper() + "\t");
                    }
                    wr.WriteLine();
                    //write rows to excel file
                    for (int i = 0; i < (dt.Rows.Count); i++)
                    {
                        for (int j = 0; j < dt.Columns.Count; j++)
                        {
                            if (dt.Rows[i][j] != null)
                            {
                                wr.Write(Convert.ToString(dt.Rows[i][j]) + "\t");
                            }
                            else
                            {
                                wr.Write("\t");
                            }
                        }
                        wr.WriteLine();
                    }
                    wr.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #5
0
        public void LoadEfficencyInformation()
        {
            DataTable     dt           = new DataTable();
            BindingSource dataBind     = new BindingSource();
            EfficencyBLL  efficencyBLL = new EfficencyBLL();

            dt = efficencyBLL.LoadEfficencyInformation();

            dataBind.DataSource = dt;
            efficencyDataGridView.DataSource = dataBind;
        }
        private void Excelbutton_Click(object sender, EventArgs e)
        {
            fromDate = Convert.ToString(Convert.ToDateTime(fromDateTimePicker.Text).ToShortDateString());
            toDate   = Convert.ToString(Convert.ToDateTime(toDateTimePicker.Text).ToShortDateString());
            plant    = plantComboBox.SelectedItem.ToString();
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();

            dt = efficency.GetIncentiveSummaryReports(fromDate, toDate, plant);
            dataBind.DataSource = dt;
            incentiveDataGridView.DataSource = dataBind;
            if (incentiveDataGridView.Rows.Count > 0)
            {
                try
                {
                    // Bind table data to Stream Writer to export data to respective folder
                    StreamWriter wr = new StreamWriter(@"E:\\Incentive_Summery_Reports.xls");
                    wr.Write("HIRDARAMANI APPARELS BANGLADESH");
                    wr.WriteLine();
                    wr.Write("SAMPLE ROOM MONTHLY INCENTIVE SUMMERY");
                    wr.WriteLine();
                    wr.WriteLine();
                    wr.WriteLine();
                    // Write Columns to excel file
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        wr.Write(dt.Columns[i].ToString().ToUpper() + "\t");
                    }
                    wr.WriteLine();
                    //write rows to excel file
                    for (int i = 0; i < (dt.Rows.Count); i++)
                    {
                        for (int j = 0; j < dt.Columns.Count; j++)
                        {
                            if (dt.Rows[i][j] != null)
                            {
                                wr.Write(Convert.ToString(dt.Rows[i][j]) + "\t");
                            }
                            else
                            {
                                wr.Write("\t");
                            }
                        }
                        wr.WriteLine();
                    }
                    wr.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        public void GetIncentiveSummaryReports(string FromDate, string ToDate, string Plant)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();

            try
            {
                dt = efficency.GetIncentiveSummaryReports(fromDate, toDate, Plant);
                dataBind.DataSource = dt;
                incentiveDataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
        public void SampleCostBrakeDownSummeryReport(string FromDate, string ToDate, double MaterialCostR1, double OverHeadCostR1, double MaterialCostK2, double OverHeadCostK2, double PlanCpm)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.SampleCostBrakeDownSummeryReport(FromDate, ToDate, MaterialCostR1, OverHeadCostR1, MaterialCostK2, OverHeadCostK2, PlanCpm);
                dataBind.DataSource = dt;
                sampleCostDataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
        public void GetProductionAndOtSummeryReport(string FromDate, string ToDate)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.GetProductionAndOtSummeryReport(FromDate, ToDate);
                dataBind.DataSource = dt;
                productionDataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
예제 #10
0
        public void DepartmentWiseForDepartmentwise(string FromDate, string ToDate, string plant)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.GetDepartmentWiseReport(FromDate, ToDate, plant);
                dataBind.DataSource = dt;
                DepartmentWisedataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
예제 #11
0
        public void BuyerWiseSampleSummerForBuyerwise(string FromDate, string ToDate, string Plant)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.GetBuyerWiseProduction(FromDate, ToDate, Plant);
                dataBind.DataSource = dt;
                buyerWisedataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
예제 #12
0
        public void ItemwiseSummerForItemWise(string FromDate, string ToDate, string Plant)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.GetItemCategoryWiseReport(FromDate, ToDate, Plant);
                dataBind.DataSource             = dt;
                ItemWisedataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
예제 #13
0
        public void GetSupervisorSummeryReport(string FromDate, string ToDate, string Plant)
        {
            EfficencyBLL  efficency = new EfficencyBLL();
            DataTable     dt        = new DataTable();
            BindingSource dataBind  = new BindingSource();


            try
            {
                dt = efficency.GetSupervisorSummeryReport(FromDate, ToDate, Plant);
                dataBind.DataSource = dt;
                SupervisordataGridView.DataSource = dataBind;
            }
            catch (Exception ex)
            {
            }
        }
예제 #14
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            EfficencyBLL   efficencyBLL = new EfficencyBLL();
            EfficencyInput efficency    = new EfficencyInput();
            DataTable      dt           = null;
            int            returnValue  = 0;


            efficency.EfficencyId = Id;
            if (plantComboBox.SelectedItem == "" || plantComboBox.SelectedItem == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select Plant");
            }
            else
            {
                efficency.Plant = plantComboBox.SelectedItem.ToString();
            }

            if (sewingTeamTextBox.Text == "" || sewingTeamTextBox.Text == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select Sewing Team");
            }
            else
            {
                efficency.SewingTeam = sewingTeamTextBox.Text;
            }

            if (SupervisorNameComboBox.SelectedItem == "" || SupervisorNameComboBox.SelectedItem == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select Supervisor");
            }
            else
            {
                efficency.Supervisor = SupervisorNameComboBox.SelectedItem.ToString();
            }

            if (attendenceTextBox.Text == "" || attendenceTextBox.Text == null)
            {
                System.Windows.Forms.MessageBox.Show("Please enter total number of attendeance");
            }
            else
            {
                efficency.Attendance = Convert.ToDecimal(attendenceTextBox.Text);
            }

            if (buyerComboBox.SelectedItem == "" || buyerComboBox.SelectedItem == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select buyer");
            }
            else
            {
                efficency.BuyerName = buyerComboBox.SelectedItem.ToString();
            }


            if (serialNumberTextBox.Text == "" || serialNumberTextBox.Text == null)
            {
                efficency.SerialNumber = "";
            }
            else
            {
                efficency.SerialNumber = serialNumberTextBox.Text;
            }

            if (styleNumberTextBox.Text == "" || styleNumberTextBox.Text == null)
            {
                System.Windows.Forms.MessageBox.Show("Please enter style number");
            }
            else
            {
                efficency.StyleNumber = styleNumberTextBox.Text;
            }

            if (sampleTypeTextBox.Text == "" || sampleTypeTextBox.Text == null)
            {
                System.Windows.Forms.MessageBox.Show("Please enter sample type");
            }
            else
            {
                efficency.SampleType = sampleTypeTextBox.Text;
            }


            if (itemCategoryComboBox.SelectedItem == "" || itemCategoryComboBox.SelectedItem == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select buyer");
            }
            else
            {
                efficency.ItemCategory = itemCategoryComboBox.SelectedItem.ToString();
            }

            if (smvFactorComboBox.SelectedItem == "" || smvFactorComboBox.SelectedItem == null)
            {
                System.Windows.Forms.MessageBox.Show("Please Select buyer");
            }
            else
            {
                efficency.SmvFactor = smvFactorComboBox.SelectedItem.ToString();
            }



            efficency.SampleMaker      = Convert.ToInt32(sampleMakerTextBox.Text);
            efficency.SampleMakingTime = Convert.ToInt32(sampleMakeTimeTextBox.Text);
            efficency.ProductQuentity  = Convert.ToInt32(productQuantityTextBox.Text);
            efficency.SmvValue         = Convert.ToDecimal(smvTextBox.Text);

            if (overtime105TextBox.Text == "" || overtime105TextBox.Text == null)
            {
                efficency.OverTime105Person = 0;
            }
            else
            {
                efficency.OverTime105Person = Convert.ToInt16(overtime105TextBox.Text);
            }

            if (overTime120TextBox.Text == "" || overTime120TextBox.Text == null)
            {
                efficency.OverTime120Person = 0;
            }
            else
            {
                efficency.OverTime120Person = Convert.ToInt16(overTime120TextBox.Text);
            }

            if (overTime90TextBox.Text == "" || overTime90TextBox.Text == null)
            {
                efficency.OverTime90Person = 0;
            }
            else
            {
                efficency.OverTime90Person = Convert.ToInt16(overTime90TextBox.Text);
            }



            if (machineLoseTextBox.Text == null || machineLoseTextBox.Text == "")
            {
                efficency.MachineLostTime = 0;
            }
            else
            {
                efficency.MachineLostTime = Convert.ToInt32(machineLoseTextBox.Text);
            }

            if (merchantLostTextBox.Text == null || merchantLostTextBox.Text == "")
            {
                efficency.MerchantLostTime = 0;
            }
            else
            {
                efficency.MerchantLostTime = Convert.ToInt32(merchantLostTextBox.Text);
            }

            if (patternLostTextBox.Text == null || patternLostTextBox.Text == "")
            {
                efficency.PatternLostTime = 0;
            }
            else
            {
                efficency.PatternLostTime = Convert.ToInt32(patternLostTextBox.Text);
            }

            if (EmbiLostTextBox.Text == null || EmbiLostTextBox.Text == "")
            {
                efficency.EmbiLostTime = 0;
            }
            else
            {
                efficency.EmbiLostTime = Convert.ToInt32(EmbiLostTextBox.Text);
            }

            if (otherLostTextBox.Text == null || otherLostTextBox.Text == "")
            {
                efficency.OtherLostTime = 0;
            }
            else
            {
                efficency.OtherLostTime = Convert.ToInt32(otherLostTextBox.Text);
            }

            efficency.TotalLostTime = efficency.MachineLostTime + efficency.MerchantLostTime + efficency.PatternLostTime + efficency.EmbiLostTime + efficency.OtherLostTime;



            if (overTime90TextBox.Text == "" || overTime90TextBox.Text == null)
            {
                efficency.OverTime90Person = 0;
            }
            else
            {
                efficency.OverTime90Person = Convert.ToInt32(overTime90TextBox.Text);
            }

            if (overtime105TextBox.Text == "" || overtime105TextBox.Text == null)
            {
                efficency.OverTime105Person = 0;
            }
            else
            {
                efficency.OverTime105Person = Convert.ToInt32(overtime105TextBox.Text);
            }

            if (overTime120TextBox.Text == "" || overTime120TextBox.Text == null)

            {
                efficency.OverTime120Person = 0;
            }
            else
            {
                efficency.OverTime120Person = Convert.ToInt32(overTime120TextBox.Text);
            }


            if (departmentComboBox.SelectedItem == "" || departmentComboBox.SelectedItem == null)
            {
                efficency.Department = "";
            }
            else
            {
                efficency.Department = departmentComboBox.SelectedItem.ToString();
            }



            efficency.OverTime90    = 90 * efficency.OverTime90Person;
            efficency.OverTime105   = 105 * efficency.OverTime105Person;
            efficency.OverTime120   = 120 * efficency.OverTime120Person;
            efficency.TotalOverTime = efficency.OverTime90 + efficency.OverTime105 + efficency.OverTime120;

            efficency.TotalOfficialTime = efficency.Attendance * Convert.ToDecimal(480);

            efficency.TotalTime = efficency.TotalOfficialTime + efficency.TotalOverTime;

            //A = 5,B = 7,C = 8,D = 9,E = 10,F = 11,G = 12

            switch (efficency.SmvFactor)
            {
            case "A":
                efficency.SmvFactorValue = 5;
                break;

            case "B":
                efficency.SmvFactorValue = 7;
                break;

            case "C":
                efficency.SmvFactorValue = 8;
                break;

            case "D":
                efficency.SmvFactorValue = 9;
                break;

            case "E":
                efficency.SmvFactorValue = 10;
                break;

            case "F":
                efficency.SmvFactorValue = 11;
                break;

            case "G":
                efficency.SmvFactorValue = 12;
                break;

            default:
                efficency.SmvFactorValue = 0;
                break;
            }

            efficency.Rating        = (Convert.ToDecimal(efficency.SmvFactorValue) / Convert.ToDecimal(efficency.SampleMaker));
            efficency.EstimatedTime = ((efficency.SmvValue * efficency.Rating) + ((efficency.ProductQuentity - 1) * ((efficency.SmvValue * efficency.Rating) / 2)));

            efficency.TotalProduceMinute = efficency.EstimatedTime * efficency.SampleMaker;


            if (efficency.ProductQuentity <= 20)
            {
                efficency.Fact1Below21 = efficency.TotalProduceMinute;
            }
            else
            {
                efficency.Fact1Below21 = 0;
            }


            if (efficency.ProductQuentity >= 21)
            {
                efficency.Fact2Above20 = efficency.TotalProduceMinute;
            }
            else
            {
                efficency.Fact2Above20 = 0;
            }

            efficency.TotalFact = efficency.Fact1Below21 + efficency.Fact2Above20;

            efficency.ActualTakenTime = efficency.SampleMaker * efficency.SampleMakingTime;



            if (efficency.ActualTakenTime == 0)
            {
                efficency.PerformancePercentage = 0;
            }
            else
            {
                efficency.PerformancePercentage = (efficency.TotalProduceMinute / efficency.ActualTakenTime) * 100;
            }
            efficency.MinimumProduceTime = efficency.TotalTime * Convert.ToDecimal(0.45);
            efficency.NonProductiveTime  = efficency.TotalTime - efficency.ActualTakenTime;

            efficency.ProductionDate = Convert.ToString(Convert.ToDateTime(productionDateTimePicker.Text).ToShortDateString());
            efficency.Comments       = commentTextBox.Text;



            if (efficency.EfficencyId == 0)
            {
                dt = efficencyBLL.InsertEfficencyData(efficency);
                if (dt.Rows.Count > 0)
                {
                    returnValue = Convert.ToInt32(dt.Rows[0]["ReturnValue"]);

                    if (returnValue > 0)
                    {
                        massageLabel.Text = "Provided Information Already Exists!!!";
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Information Successfully Saved");
                        //massageLabel.Text = "Information Successfully Saved";
                        LoadEfficencyInformation();
                        ClearEfficencyInfo();
                    }
                }
            }
            else
            {
                int actionResult = 0;
                actionResult = efficencyBLL.UpdateEfficencyInfo(efficency);
                if (actionResult > 0)
                {
                    massageLabel.Text = "Information Successfully Updated";
                    LoadEfficencyInformation();
                    ClearEfficencyInfo();
                }
                else
                {
                    massageLabel.Text = "Provided Information Already Exists!!!";
                }
            }
        }