protected void btnModifySave_Click(object sender, EventArgs e) { try { clsLeaveFileView objData = new clsLeaveFileView(); objData.LeaveID = txtModifyLeaveID.Text.Trim(); objData.LeaveDescr = txtModifyLeaveDesc.Text; objData.CreatedBy = Session["uid"].ToString(); objData.IsPaid = Convert.ToBoolean(cmbModifyPaidLeave.SelectedValue); objData.LeaveGroup = cmbModifyLeaveGroup.SelectedValue; clsLeaveFileViewHandler.UpdateLeaveDetails(objData, "Update", "", ref strErrMsg, ref strSuccMsg, clsCommonHandler.PageName()); if (strErrMsg.Trim().Length >= 1) { lblEditError.Visible = true; lblEditError.Text = strErrMsg; return; } else { mpeModifyLeave.Hide(); lblMessages.Visible = true; lblMessages.Text = strSuccMsg; bindDataGrid(); } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }
protected void BtnAddSave_Click(object sender, EventArgs e) { try { clsLeaveFileView objData = new clsLeaveFileView(); objData.LeaveID = txtleaveID.Text.Trim(); objData.LeaveDescr = txtleaveDescription.Text; objData.CreatedBy = Session["uid"].ToString(); objData.IsPaid = Convert.ToBoolean(cmbPaidLeave.SelectedValue); objData.LeaveGroup = cmbLeaveGroup.SelectedValue; clsLeaveFileViewHandler.UpdateLeaveDetails(objData, "Insert", "", ref strErrMsg, ref strSuccMsg, clsCommonHandler.PageName()); if (strErrMsg.Trim().Length >= 1) { lblErrorAdd.Visible = true; lblErrorAdd.Text = strErrMsg; return; } else { mpeAddLeave.Show(); lblErrorAdd.Visible = true; lblErrorAdd.Text = strSuccMsg; txtleaveID.Text = ""; txtleaveDescription.Text = ""; cmbPaidLeave.SelectedIndex = 0; cmbLeaveGroup.SelectedIndex = 0; bindDataGrid(); } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }
protected void btnDelete_Click(object sender, EventArgs e) { StringBuilder strXML = new StringBuilder(); bool check = false; int count = 0; try { strXML.Append("<TA_Leave_File>"); for (int i = 0; i < gvLeave.Rows.Count; i++) { CheckBox chk = (CheckBox)gvLeave.Rows[i].FindControl("DeleteRows"); if (chk.Checked == true) { count++; check = true; strXML.Append("<Leave>"); strXML.Append("<Leave_ID>" + gvLeave.Rows[i].Cells[2].Text + "</Leave_ID>"); strXML.Append("</Leave>"); } } strXML.Append("</TA_Leave_File>"); if (count > 0) { clsLeaveFileView objData = new clsLeaveFileView(); objData.LeaveID = txtModifyLeaveID.Text.Trim(); objData.LeaveDescr = txtModifyLeaveDesc.Text; objData.CreatedBy = Session["uid"].ToString(); objData.IsPaid = Convert.ToBoolean(cmbModifyPaidLeave.SelectedValue); objData.LeaveGroup = cmbModifyLeaveGroup.SelectedValue; clsLeaveFileViewHandler.UpdateLeaveDetails(objData, "Delete", strXML.ToString(), ref strErrMsg, ref strSuccMsg, clsCommonHandler.PageName()); if (strErrMsg.Trim().Length >= 1) { lblMessages.Visible = true; lblMessages.Text = strErrMsg; return; } else { lblMessages.Visible = true; lblMessages.Text = strSuccMsg; bindDataGrid(); return; } } if (check == false) { lblMessages.Text = "Please select record to delete."; lblMessages.Visible = true; } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }
public void ModifyLeaveMaster(string strRowid) { try { clsLeaveFileView objData = clsLeaveFileViewHandler.GetLeaveDetails("FillEditData", Convert.ToInt32(strRowid)); if (objData != null) { txtModifyLeaveID.Text = objData.LeaveID; txtModifyLeaveDesc.Text = objData.LeaveDescr; cmbModifyPaidLeave.SelectedValue = Convert.ToString(objData.IsPaid); cmbModifyLeaveGroup.SelectedValue = objData.LeaveGroup; } else { lblMessages.Visible = true; lblMessages.Text = "Records not found"; } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }