Esempio n. 1
0
        protected void lnkbtnSave_OnClick(object sender, EventArgs e)
        {
            Int32  empIdno = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString());
            string strMsg  = string.Empty;
            ContainerTypeMasterDAL objclsConTypeMaster = new ContainerTypeMasterDAL();
            Int64 intConTypeIdno = 0;

            if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == true)
            {
                intConTypeIdno = objclsConTypeMaster.Insert(txtConType.Text.Trim(), Convert.ToBoolean(chkStatus.Checked), empIdno);
            }
            else
            {
                intConTypeIdno = objclsConTypeMaster.Update(txtConType.Text.Trim(), Convert.ToBoolean(chkStatus.Checked), Convert.ToInt32(hidIGrpMastidno.Value), empIdno);
            }
            objclsConTypeMaster = null;
            if (intConTypeIdno > 0)
            {
                if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == false)
                {
                    ShowMessage("Record updated successfully.");
                }
                else
                {
                    ShowMessage("Record saved successfully.");
                }
                this.ClearControls();
            }
            else if (intConTypeIdno < 0)
            {
                ShowMessageErr("Record already exists.");
            }
            else
            {
                if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == false)
                {
                    ShowMessageErr("Record not updated.");
                }
                else
                {
                    ShowMessageErr("Record not saved.");
                }
            }
            lnkbtnNew.Visible = false;
        }