protected void ddlRepColumn_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlRepColumn.SelectedValue == "-Select-") { txtRepColumn.Focus(); txtRepColumn.Text = string.Empty; txtRepColumnName.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } if (ddlRepColumn.SelectedValue != "-Select-") { DateTime Repdate = DateTime.ParseExact(txtReportDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); int MainCode = Converter.GetInteger(ddlRepColumn.SelectedValue); A2ZREPORTLAYOUTDTO getDTO = (A2ZREPORTLAYOUTDTO.GetInformation(MainCode, Repdate)); if (getDTO.RepColumn > 0) { txtRepColumn.Text = Converter.GetString(getDTO.RepColumn); txtRepColumnName.Text = Converter.GetString(getDTO.RepColumnName); if (MainCode < 8) { lblRepColFlag.Text = "Allowance"; Allowgridview(); MoveAllowChkMark(); } else { lblRepColFlag.Text = "Deduction"; Dedgridview(); MoveDedChkMark(); } BtnSubmit.Visible = false; BtnUpdate.Visible = true; txtRepColumnName.Focus(); gvDescription.Visible = true; } else { txtRepColumn.Focus(); txtRepColumn.Text = string.Empty; txtRepColumnName.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlRepColumn_SelectedIndexChanged Problem');</script>"); //throw ex; } }
protected void BtnUpdate_Click(object sender, EventArgs e) { try { A2ZREPORTLAYOUTDTO objDTO = new A2ZREPORTLAYOUTDTO(); int MainCode = Converter.GetInteger(txtRepColumn.Text); DateTime Repdate = DateTime.ParseExact(txtReportDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); string strqry = "DELETE A2ZREPORTLAYOUT Where RepColumn='" + MainCode + "'"; int rowwEffect = Converter.GetInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(strqry, "A2ZHRMCUS")); if (rowwEffect > 0) { for (int i = 0; i < gvDescription.Rows.Count; i++) { int Code = Converter.GetInteger(gvDescription.Rows[i].Cells[0].Text); CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription"); if (chk.Checked) { objDTO.Code = Converter.GetInteger(Code); objDTO.RepColumn = Converter.GetInteger(txtRepColumn.Text); objDTO.RepColumnName = Converter.GetString(txtRepColumnName.Text); objDTO.RepColumnCode = Converter.GetInteger(Code); objDTO.RepDate = Converter.GetDateTime(Repdate); if (MainCode < 8) { objDTO.RepColumnFlag = Converter.GetSmallInteger(1); } else { objDTO.RepColumnFlag = Converter.GetSmallInteger(2); } int row = A2ZREPORTLAYOUTDTO.InsertInformation(objDTO); } } } dropdown(); clearinfo(); gvDescription.Visible = false; BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtRepColumn.Focus(); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnUpdate_Click Problem');</script>"); //throw ex; } }
protected void BtnSubmit_Click(object sender, EventArgs e) { try { int nflag = 0; A2ZREPORTLAYOUTDTO objDTO = new A2ZREPORTLAYOUTDTO(); int MainCode = Converter.GetInteger(txtRepColumn.Text); DateTime Repdate = DateTime.ParseExact(txtReportDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); objDTO.RepDate = Converter.GetDateTime(Repdate); objDTO.RepColumn = Converter.GetInteger(txtRepColumn.Text); objDTO.RepColumnName = Converter.GetString(txtRepColumnName.Text); if (MainCode < 8) { objDTO.RepColumnFlag = Converter.GetSmallInteger(1); } else { objDTO.RepColumnFlag = Converter.GetSmallInteger(2); } for (int i = 0; i < gvDescription.Rows.Count; i++) { int Code = Converter.GetInteger(gvDescription.Rows[i].Cells[0].Text); CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription"); if (chk.Checked) { objDTO.Code = Converter.GetInteger(Code); objDTO.RepColumnCode = Converter.GetInteger(Code); int row = A2ZREPORTLAYOUTDTO.InsertInformation(objDTO); nflag = 1; } } if (nflag == 0) { int row = A2ZREPORTLAYOUTDTO.InsertInformation(objDTO); } txtRepColumn.Focus(); clearinfo(); dropdown(); gvDescription.Visible = false; } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnSubmit_Click Problem');</script>"); //throw ex; } }