Пример #1
0
        public RPDActivityDetailsLabour Get(long ID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@ActivityDetailsLabourID", ID)
                };


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

                RPDActivityDetailsLabour obj = new RPDActivityDetailsLabour();

                if (dt.Rows.Count > 0)
                {
                    obj.ActivityDetailsLabourID = Convert.ToInt64(dt.Rows[0]["ActivityDetailsLabourID"]);
                    obj.BatchActID  = Convert.ToInt64(dt.Rows[0]["BatchActID"]);
                    obj.Description = Convert.ToString(dt.Rows[0]["Description"]);
                    obj.Helper      = Convert.ToString(dt.Rows[0]["Helper"]);
                    obj.StartTime_D = Convert.ToDateTime(dt.Rows[0]["StartTime"]);
                    obj.StopTime_D  = Convert.ToDateTime(dt.Rows[0]["StopTime"]);
                    obj.OTHours     = Convert.ToDecimal(dt.Rows[0]["OTHours"]);
                    obj.HourlyRate  = Convert.ToDecimal(dt.Rows[0]["HourlyRate"]);
                    obj.OTRate      = Convert.ToDecimal(dt.Rows[0]["OTRate"]);
                }

                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Пример #2
0
        public long Add(RPDActivityDetailsLabour obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@ActivityDetailsLabourID", obj.ActivityDetailsLabourID),
                    new SqlParameter("@BatchActID", obj.BatchActID),
                    new SqlParameter("@Description", obj.Description),
                    new SqlParameter("@Helper", obj.Helper),
                    new SqlParameter("@StartTime", obj.StartTime),
                    new SqlParameter("@StopTime", obj.StopTime),
                    new SqlParameter("@OTHours", obj.OTHours),
                    new SqlParameter("@outParam", SqlDbType.Int)
                    {
                        Direction = ParameterDirection.Output
                    }
                };

                return(Execute.RunSP_Output(Connection, "SPADD_RPDActivityDetailsLabour_Update", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Пример #3
0
        public RPDActivityDetailsLabourCollec Get_All()
        {
            try
            {
                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDActivityDetailsLabour");

                RPDActivityDetailsLabourCollec objCollec = new RPDActivityDetailsLabourCollec();
                RPDActivityDetailsLabour       obj       = new RPDActivityDetailsLabour();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        obj.ActivityDetailsLabourID = Convert.ToInt64(dt.Rows[i]["ActivityDetailsLabourID"]);
                        obj.BatchActID  = Convert.ToInt64(dt.Rows[i]["BatchActID"]);
                        obj.Description = Convert.ToString(dt.Rows[i]["Description"]);
                        obj.Helper      = Convert.ToString(dt.Rows[i]["Helper"]);
                        obj.StartTime_D = Convert.ToDateTime(dt.Rows[i]["StartTime"]);
                        obj.StopTime_D  = Convert.ToDateTime(dt.Rows[i]["StopTime"]);
                        obj.OTHours     = Convert.ToDecimal(dt.Rows[i]["OTHours"]);
                        obj.HourlyRate  = Convert.ToDecimal(dt.Rows[i]["HourlyRate"]);
                        obj.OTRate      = Convert.ToDecimal(dt.Rows[i]["OTRate"]);


                        objCollec.Add(obj);
                    }
                }

                return(objCollec);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Пример #4
0
        private void ClearForm()
        {
            objRPDActivityDetailsLabour = null;
            txtDescription.Text         = "";
            txtFinalQty.Text            = "0.00";
            txtNoofPackets.Text         = "0";
            txtOT.Text         = "0.00";
            txtPacketSize.Text = "0.00";
            txtStartQty.Text   = "0.00";
            txtStopQty.Text    = "0.00";
            dtpStartTime.Value = Convert.ToDateTime("7/15/2009 8:00 AM");;
            dtpStopTime.Value  = Convert.ToDateTime("7/15/2009 5:00 PM");;
            btnDelete.Enabled  = false;
            ucEmployeeSelect1.Clear();
            bindLabours.DataSource = objRPDActivityDetailsLabourDL.Get_By_BatchAct_View(objRPDBatchActivityDetails.BatchActDetailsID);
            dtStopDate.Value       = DateTime.Now;
            dtStartDate.Value      = DateTime.Now;

            lblStopDate.Visible = false;
            lblStopQty.Visible  = false;
            lblStopTime.Visible = false;

            dtpStopTime.Visible = false;
            dtStopDate.Visible  = false;
            txtStopQty.Visible  = false;


            lblOT.Visible = false;
            txtOT.Visible = false;

            cbMultiple.Visible = false;
            lblNoofRec.Visible = false;
            txtNoofRec.Visible = false;
            txtNoofRec.Text    = "0";
            ucEmployeeSelect1_EmployeeSelectedIndexChanged(this, new EventArgs());
        }
Пример #5
0
        private void txtOTMinutes_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (objRPDBatchActivity.ActivityStatus == RPDBatchActivity.Status.Finalized)
                    {
                        MessageBox.Show(this, "Activity is already Finished", "Wrong Attempt", MessageBoxButtons.OK);

                        Clear_Labour();
                    }
                    else
                    {
                        try
                        {
                            Decimal OTHours   = 0;
                            Decimal OTMinutes = 0;

                            if (txtOT.Text != "")
                            {
                                OTHours = Convert.ToDecimal(txtOT.Text);
                            }
                            if (txtOTMinutes.Text != "")
                            {
                                OTMinutes = Convert.ToDecimal(txtOTMinutes.Text);
                            }

                            RPDActivityDetailsLabour obj = new RPDActivityDetailsLabour();


                            obj.BatchActID = objRPDBatchActivity.RPDBatchActID;

                            obj.OTHours     = Calculate.CalOTHours(OTHours, OTMinutes);
                            obj.StartTime   = txtFrom.Text;
                            obj.StopTime    = txtTo.Text;
                            obj.Description = "No";

                            int count = 0;

                            for (int i = 0; i < dgvEmployeeList.Rows.Count; i++)
                            {
                                if (Convert.ToBoolean(dgvEmployeeList.Rows[i].Cells["Select"].Value) == true)
                                {
                                    obj.Helper = dgvEmployeeList.Rows[i].Cells["EmpID"].Value.ToString();
                                    count++;

                                    objRPDActivityDetailsLabour_DL.Add(obj);
                                }
                            }

                            Clear_Labour();

                            this.Close();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show(this, "Error occured while loading Labour Details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }
Пример #6
0
        private void txtOTMinutes_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (objRPDBatchActivity.ActivityStatus == RPDBatchActivity.Status.Finalized)
                    {
                        MessageBox.Show(this, "Activity is already Finished", "Wrong Attempt", MessageBoxButtons.OK);

                        Clear_Labour();
                    }
                    else
                    {
                        try
                        {
                            Decimal OTHours   = 0;
                            Decimal OTMinutes = 0;

                            if (txtOT.Text != "")
                            {
                                OTHours = Convert.ToDecimal(txtOT.Text);
                            }
                            if (txtOTMinutes.Text != "")
                            {
                                OTMinutes = Convert.ToDecimal(txtOTMinutes.Text);
                            }

                            RPDActivityDetailsLabour obj = new RPDActivityDetailsLabour();


                            obj.BatchActID  = RPDBatchActivityID;
                            obj.Helper      = cmbEmployee.SelectedValue.ToString();
                            obj.OTHours     = Calculate.CalOTHours(OTHours, OTMinutes);
                            obj.StartTime   = txtFrom.Text;
                            obj.StopTime    = txtTo.Text;
                            obj.Description = "No";


                            if (rdbOutsource.Checked == true)
                            {
                                int theCount = Convert.ToInt32(txtNos.Text);

                                for (int i = 0; i < theCount; i++)
                                {
                                    objRPDActivityDetailsLabour_DL.Add(obj);
                                }
                            }
                            else
                            {
                                objRPDActivityDetailsLabour_DL.Add(obj);
                            }



                            Load_Labour_List();

                            Clear_Labour();

                            // Load_Activity_List();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show(this, "Error occured while loading Labour Details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
            }
        }