예제 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            mbw = new MBoreWater();
            bbw = new BBoreWater();
            int Result = 0;

            mbw.BoreWaterId      = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            mbw.BoreWaterDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mbw.BoreWaterShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mbw.OperatedBy       = string.IsNullOrEmpty(txtOperatedBy.Text) ? string.Empty : txtOperatedBy.Text;
            mbw.StartingTime     = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text;
            mbw.EndTime          = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text;
            mbw.TotalHours       = string.IsNullOrEmpty(txtTotalHours.Text) ? string.Empty : txtTotalHours.Text;
            mbw.flag             = "Update";
            Result = bbw.borewaterdata(mbw);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Bore Water Data Updated  Successfully";
                pnlError.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }
예제 #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            mbw = new MBoreWater();
            bbw = new BBoreWater();
            int Result = 0;

            mbw.BoreWaterId      = 0;
            mbw.BoreWaterDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mbw.BoreWaterShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mbw.OperatedBy       = string.IsNullOrEmpty(txtOperatedBy.Text)?string.Empty :txtOperatedBy.Text;
            mbw.StartingTime     = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text;
            mbw.EndTime          = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text;
            mbw.TotalHours       = string.IsNullOrEmpty(txtTotalHours.Text) ? string.Empty : txtTotalHours.Text;
            mbw.flag             = "insert";
            Result = bbw.borewaterdata(mbw);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Bore Water Data Added  Successfully";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx2').removeClass('collapsed-box');", true);
                pnlError.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }
예제 #3
0
        public int borewaterdata(MBoreWater receive)
        {
            dabw = new DABoreWater();
            int Result = 0;

            try
            {
                Result = dabw.borewaterdata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
예제 #4
0
        public int borewaterdata(MBoreWater receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("BoreWaterId", receive.BoreWaterId));
                paramcollection.Add(new DBParameter("BoreWaterDate", receive.BoreWaterDate));
                paramcollection.Add(new DBParameter("BoreWaterShiftId", receive.BoreWaterShiftId));
                paramcollection.Add(new DBParameter("OperatedBy", receive.OperatedBy));
                paramcollection.Add(new DBParameter("StartingTime", receive.StartingTime));
                paramcollection.Add(new DBParameter("EndTime", receive.EndTime));
                paramcollection.Add(new DBParameter("TotalHours", receive.TotalHours));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_BoreWaterDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                string MSG = EX.ToString();
            }
            return(result);
        }