예제 #1
0
        protected void ddlSubGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlSubGroup.SelectedValue != "-Select-" && ddlGroup.SelectedValue != "-Select-")
                {
                    A2ZSUBGROUPDTO getDTO   = new A2ZSUBGROUPDTO();
                    int            code     = Converter.GetInteger(ddlGroup.SelectedValue);
                    int            distcode = Converter.GetInteger(ddlSubGroup.SelectedValue);
                    getDTO = (A2ZSUBGROUPDTO.GetInformation(code, distcode));

                    if (getDTO.GrpCode > 0 && getDTO.SubGrpCode > 0)
                    {
                        hdnSubGrpCode.Text = Converter.GetString(getDTO.SubGrpCode);

                        txtSubGrpDescription.Text = Converter.GetString(getDTO.SubGrpDescription);
                        txtSubGrpDescription.Focus();
                        BtnSubmit.Visible = false;
                        BtnUpdate.Visible = true;
                    }
                }
                else
                {
                    BtnUpdate.Visible = false;
                    BtnSubmit.Visible = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            if (ddlGroup.SelectedValue != "-Select-" && ddlItemType.SelectedValue != "-Select-")
            {
                int            LR         = 0;
                int            GrpCode    = Converter.GetInteger(ddlGroup.SelectedValue);
                int            SubGrpCode = Converter.GetInteger(ddlItemType.SelectedValue);
                A2ZSUBGROUPDTO getDTO     = (A2ZSUBGROUPDTO.GetInformation(GrpCode, SubGrpCode));
                if (getDTO.LastRec >= 0)
                {
                    LR  = Converter.GetInteger(getDTO.LastRec);
                    LR += 1;
                    hdnNewSTKNo.Text = SubGrpCode.ToString("0") + GrpCode.ToString("00") + LR.ToString("0000");
                }

                A2ZSTOCKDTO objDTO = new A2ZSTOCKDTO();
                objDTO.STKItemCode     = Converter.GetInteger(hdnNewSTKNo.Text);
                objDTO.STKItemName     = Converter.GetString(txtItemDesc.Text);
                objDTO.STKUnit         = Converter.GetInteger(ddlUnitMeasure.SelectedValue);
                objDTO.STKGroup        = Converter.GetInteger(ddlGroup.SelectedValue);
                objDTO.STKSubGroup     = Converter.GetInteger(ddlItemType.SelectedValue);
                objDTO.STKStatus       = 1;
                objDTO.STKStatusDesc   = "Active";
                objDTO.STKReOrderLevel = Converter.GetInteger(txtReorderLvl.Text);

                A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue();
                objDTO.STKStatusDate = Converter.GetDateTime(dto.ProcessDate.ToLongDateString());

                int roweffect = A2ZSTOCKDTO.InsertInformation(objDTO);
                if (roweffect > 0)
                {
                    A2ZSUBGROUPDTO SubGrpDTO = new A2ZSUBGROUPDTO();
                    SubGrpDTO.GrpCode    = GrpCode;
                    SubGrpDTO.SubGrpCode = SubGrpCode;
                    SubGrpDTO.LastRec    = LR;
                    int roweffect1 = A2ZSUBGROUPDTO.UpdateLastRec(SubGrpDTO);
                    if (roweffect1 > 0)
                    {
                        Response.Redirect(Request.RawUrl);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Select Group and Sub Group');", true);
                return;
            }
        }
예제 #3
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            if (txtSubGrpDescription.Text != string.Empty)
            {
                gvDetail();
                gvDetailInfo.Visible = false;

                int totrec = gvDetailInfo.Rows.Count;

                int lastSubGrpCode = (totrec + 1);
                hdnSubGrpCode.Text = Converter.GetString(lastSubGrpCode);

                if (lastSubGrpCode < 10)
                {
                    hdnSubGrpCode.Text = Converter.GetString("0" + lastSubGrpCode);
                }


                A2ZSUBGROUPDTO objDTO = new A2ZSUBGROUPDTO();
                objDTO.GrpCode    = Converter.GetInteger(hdnGrpCode.Text);
                objDTO.SubGrpCode = Converter.GetInteger(hdnSubGrpCode.Text);

                objDTO.SubGrpDescription = Converter.GetString(txtSubGrpDescription.Text);

                int roweffect = A2ZSUBGROUPDTO.InsertInformation(objDTO);
                if (roweffect > 0)
                {
                    clearInfo();
                    SubGroupDropdown();
                    gvDetail();
                    gvDetailInfo.Visible = false;
                    BtnUpdate.Visible    = false;
                    BtnSubmit.Visible    = true;
                    txtSubGrpDescription.Focus();
                }
            }
        }
예제 #4
0
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            if (ddlSubGroup.SelectedValue != "-Select-" && ddlGroup.SelectedValue != "-Select-")
            {
                A2ZSUBGROUPDTO UpDTO = new A2ZSUBGROUPDTO();
                UpDTO.GrpCode    = Converter.GetInteger(hdnGrpCode.Text);
                UpDTO.SubGrpCode = Converter.GetInteger(hdnSubGrpCode.Text);

                UpDTO.SubGrpDescription = Converter.GetString(txtSubGrpDescription.Text);


                int roweffect = A2ZSUBGROUPDTO.UpdateInformation(UpDTO);
                if (roweffect > 0)
                {
                    clearInfo();
                    SubGroupDropdown();
                    gvDetail();
                    gvDetailInfo.Visible = false;
                    BtnUpdate.Visible    = false;
                    BtnSubmit.Visible    = true;
                    txtSubGrpDescription.Focus();
                }
            }
        }