protected void lnkgrpsave_Click(object sender, EventArgs e)
        {
            Int32           empIdno            = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString());
            string          strMsg             = string.Empty;
            ItmGrpMasterDAL objclsItmGrpMaster = new ItmGrpMasterDAL();
            Int64           intIGrpIdno        = 0;
            int             IGrpType           = 0;

            if (txtGName.Text != "")
            {
                intIGrpIdno = objclsItmGrpMaster.Insert(txtGName.Text.Trim(), IGrpType, Convert.ToBoolean(chkactive.Checked), empIdno);
            }

            if ((intIGrpIdno > 0))
            {
                strMsg        = "Record saved successfully";
                txtGName.Text = "";
                BindGroupType();
                ddlGroupType.SelectedValue = Convert.ToString(intIGrpIdno);
                ddlGroupType.Focus();
            }
            else if (intIGrpIdno == -1)
            {
                strMsg = "Record already exists!";
            }
            else
            {
                strMsg = "Oops technical error occurs!";
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true);
        }
Exemplo n.º 2
0
        protected void lnkbtnSaveGroup_OnClick(object sender, EventArgs e)
        {
            string          strMsg             = string.Empty;
            ItmGrpMasterDAL objclsItmGrpMaster = new ItmGrpMasterDAL();
            Int64           intIGrpIdno        = 0;
            int             IGrpType           = Convert.ToInt32(ddlItemGropForPopup.SelectedValue);
            Int32           empIdno            = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString());

            intIGrpIdno = objclsItmGrpMaster.Insert(txtGroupNameForPopup.Text.Trim(), IGrpType, true, empIdno);

            objclsItmGrpMaster = null;
            if (intIGrpIdno > 0)
            {
                BindGroupType();
                strMsg = "Record saved successfully.";

                this.ClearControlsForGroup();
            }
            else if (intIGrpIdno < 0)
            {
                strMsg = "Record already exists.";
            }
            else
            {
                strMsg = "Record not saved.";
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true);
        }
        protected void lnkbtnSave_OnClick(object sender, EventArgs e)
        {
            Int32           empIdno            = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString());
            string          strMsg             = string.Empty;
            ItmGrpMasterDAL objclsItmGrpMaster = new ItmGrpMasterDAL();
            Int64           intIGrpIdno        = 0;
            int             IGrpType           = Convert.ToInt32(ddlItemType.SelectedValue);

            if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == true)
            {
                intIGrpIdno = objclsItmGrpMaster.Insert(txtGName.Text.Trim(), IGrpType, Convert.ToBoolean(chkStatus.Checked), empIdno);
            }
            else
            {
                intIGrpIdno = objclsItmGrpMaster.Update(txtGName.Text.Trim(), IGrpType, Convert.ToBoolean(chkStatus.Checked), Convert.ToInt32(hidIGrpMastidno.Value), empIdno);
            }
            objclsItmGrpMaster = null;
            if (intIGrpIdno > 0)
            {
                if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == false)
                {
                    ShowMessage("Record updated successfully.");
                }
                else
                {
                    ShowMessage("Record saved successfully.");
                }
                this.ClearControls();
                lnkbtnNew.Visible = false;
            }
            else if (intIGrpIdno < 0)
            {
                ShowMessageErr("Record already exists.");
            }
            else
            {
                if (string.IsNullOrEmpty(hidIGrpMastidno.Value) == false)
                {
                    ShowMessageErr("Record not updated.");
                }
                else
                {
                    ShowMessageErr("Record not saved.");
                }
            }
        }
Exemplo n.º 4
0
        protected void imgBtnSave_Click(object sender, EventArgs e)
        {
            string          strMsg             = string.Empty;
            ItmGrpMasterDAL objclsItmGrpMaster = new ItmGrpMasterDAL();
            Int64           intIGrpIdno        = 0;
            int             IGrpType           = Convert.ToInt32(ddlItemType.SelectedValue);
            Int32           empIdno            = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString());

            intIGrpIdno = objclsItmGrpMaster.Insert(txtGName.Text.Trim(), IGrpType, Convert.ToBoolean(chkStatus.Checked), empIdno);

            objclsItmGrpMaster = null;
            if (intIGrpIdno > 0)
            {
                //lnkbtnNew.Visible = false;
            }
            else if (intIGrpIdno < 0)
            {
                strMsg = "Record already exists.";
            }
            else
            {
                strMsg = "Record not saved.";
            }
        }