Ejemplo n.º 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            mftp = new MEffluentTreatmentPlant();
            bftp = new BEffluentTreatmentPlant();
            int Result = 0;

            mftp.EffluentTreatmentPlantId      = 0;
            mftp.EffluentTreatmentPlantDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mftp.EffluentTreatmentPlantShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mftp.OperatedBy = string.IsNullOrEmpty(txtOperatedBy.Text) ? string.Empty : txtOperatedBy.Text;
            mftp.Remarks    = string.IsNullOrEmpty(txtRemarks.Text) ? string.Empty : txtRemarks.Text;
            mftp.CollectionPumpAStartingTime      = string.IsNullOrEmpty(txtAStartingTime.Text) ? string.Empty : txtAStartingTime.Text;
            mftp.CollectionPumpAEndTime           = string.IsNullOrEmpty(txtAEndTime.Text) ? string.Empty : txtAEndTime.Text;
            mftp.CollectionPumpATotalRunningHours = string.IsNullOrEmpty(txtATotalHours.Text) ? string.Empty : txtATotalHours.Text;
            mftp.CollectionPumpBStartingTime      = string.IsNullOrEmpty(txtBStartingTime.Text) ? string.Empty : txtBStartingTime.Text;
            mftp.CollectionPumpBEndTime           = string.IsNullOrEmpty(txtBEndTime.Text) ? string.Empty : txtBEndTime.Text;
            mftp.CollectionPumpBTotalRunningHours = string.IsNullOrEmpty(txtBTotalHours.Text) ? string.Empty : txtBTotalHours.Text;
            mftp.AERATORStartingTime                       = string.IsNullOrEmpty(txtAERATORStartingTime.Text) ? string.Empty : txtAERATORStartingTime.Text;
            mftp.AERATOREndTime                            = string.IsNullOrEmpty(txtAERATOREndTime.Text) ? string.Empty : txtAERATOREndTime.Text;
            mftp.AERATORTotalRunningHours                  = string.IsNullOrEmpty(txtAERATORTotalHours.Text) ? string.Empty : txtAERATORTotalHours.Text;
            mftp.BLOWERAStartingTime                       = string.IsNullOrEmpty(txtBLOWERAStartingTime.Text) ? string.Empty : txtBLOWERAStartingTime.Text;
            mftp.BLOWERAEndTime                            = string.IsNullOrEmpty(txtBLOWERAEndTime.Text) ? string.Empty : txtBLOWERAEndTime.Text;
            mftp.BLOWERATotalRunningHours                  = string.IsNullOrEmpty(txtBLOWERATotalHours.Text) ? string.Empty : txtBLOWERATotalHours.Text;
            mftp.BLOWERBStartingTime                       = string.IsNullOrEmpty(txtBLOWERBStartingTime.Text) ? string.Empty : txtBLOWERBStartingTime.Text;
            mftp.BLOWERBEndTime                            = string.IsNullOrEmpty(txtBLOWERBEndTime.Text) ? string.Empty : txtBLOWERBEndTime.Text;
            mftp.BLOWERBTotalRunningHours                  = string.IsNullOrEmpty(txtBLOWERBTotalHours.Text) ? string.Empty : txtBLOWERBTotalHours.Text;
            mftp.ClarifierMechanismStartingTime            = string.IsNullOrEmpty(txtClarifierMechanismStartingTime.Text) ? string.Empty : txtClarifierMechanismStartingTime.Text;
            mftp.ClarifierMechanismEndTime                 = string.IsNullOrEmpty(txtClarifierMechanismEndTime.Text) ? string.Empty : txtClarifierMechanismEndTime.Text;
            mftp.ClarifierMechanismTotalRunningHours       = string.IsNullOrEmpty(txtClarifierMechanismTotalHours.Text) ? string.Empty : txtClarifierMechanismTotalHours.Text;
            mftp.SludgeReCirculationPumpAStartingTime      = string.IsNullOrEmpty(txtSludgeReCirculationpumpAStartingTime.Text) ? string.Empty : txtSludgeReCirculationpumpAStartingTime.Text;
            mftp.SludgeReCirculationPumpAEndTime           = string.IsNullOrEmpty(txtSludgeReCirculationpumpAEndTime.Text) ? string.Empty : txtSludgeReCirculationpumpAEndTime.Text;
            mftp.SludgeReCirculationPumpATotalRunningHours = string.IsNullOrEmpty(txtSludgeReCirculationpumpATotalHours.Text) ? string.Empty : txtSludgeReCirculationpumpATotalHours.Text;
            mftp.SludgeReCirculationPumpBStartingTime      = string.IsNullOrEmpty(txtSludgeReCirculationpumpBStartingTime.Text) ? string.Empty : txtSludgeReCirculationpumpBStartingTime.Text;
            mftp.SludgeReCirculationPumpBEndTime           = string.IsNullOrEmpty(txtSludgeReCirculationpumpBEndTime.Text) ? string.Empty : txtSludgeReCirculationpumpBEndTime.Text;
            mftp.SludgeReCirculationPumpBTotalRunningHours = string.IsNullOrEmpty(txtSludgeReCirculationpumpBTotalHours.Text) ? string.Empty : txtSludgeReCirculationpumpBTotalHours.Text;
            mftp.flag = "insert";
            Result    = bftp.effluntplantdata(mftp);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Effluent Treatment Plant 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();
            }
        }