private void FillFeedBackList() { objUserTask = new UserTaskDB(); DataTable dt = null; try { this.gvFeedBack.Rows.Clear(); dt = objUserTask.UserFeedBack_Get(cbFeedBackType.Text).Tables[0]; if (dt.Rows.Count > 0) { for (int intRow = 0; intRow < dt.Rows.Count; intRow++) { gvFeedBack.Rows.Add(); gvFeedBack.Rows[intRow].Cells["SLNO"].Value = intRow + 1; gvFeedBack.Rows[intRow].Cells["FeedBackNo"].Value = dt.Rows[intRow]["FBNO"].ToString(); gvFeedBack.Rows[intRow].Cells["FeedBackType"].Value = dt.Rows[intRow]["FBTYPE"].ToString(); gvFeedBack.Rows[intRow].Cells["EnterDate"].Value = dt.Rows[intRow]["EntryDate"].ToString(); gvFeedBack.Rows[intRow].Cells["FeedBackGV"].Value = dt.Rows[intRow]["FeedBack"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Feed Back", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { objUserTask = null; } }
private void btnSave_Click(object sender, EventArgs e) { string strSQl = string.Empty; objData = new SQLDB(); objUtil = new UtilityDB(); string strFBNo = string.Empty; try { if (CheckData()) { objUserTask = new UserTaskDB(); strFBNo = objUserTask.GenerateFeedBackTranNo().ToString(); strSQl = " INSERT into CRM_FEEDBACK (CF_COMPANY_CODE , CF_STATE_CODE, CF_BRANCH_CODE, CF_FIN_YEAR,CF_TRN_TYPE,CF_TRN_NUMBER,CF_TRN_DATE,CF_TRN_REM,CF_CREATED_BY,CF_CREATED_DATE)" + " VALUES('" + CommonData.CompanyCode + "', '" + CommonData.StateCode + "', '" + CommonData.BranchCode + "', '" + CommonData.FinancialYear + "', '" + cbFeedBackType.Text + "', '" + strFBNo + "', '" + Convert.ToDateTime(CommonData.CurrentDate).ToString("dd/MMM/yyyy") + "', '" + txtFeedBack.Text + "', '" + CommonData.LogUserId + "', '" + Convert.ToDateTime(CommonData.CurrentDate).ToString("dd/MMM/yyyy") + "' )"; int rec = objData.ExecuteSaveData(strSQl); if (rec > 0) { objUtil.SendMail(CommonData.LogUserEcode + "-" + CommonData.LogUserName, CommonData.BranchName, txtFeedBack.Text); } txtFeedBack.Text = ""; FillFeedBackList(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Feed back", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { } }
private void MenuEnableDisable() { objTask = new UserTaskDB(); try { if (CommonData.LogUserId.ToUpper() != "ADMIN") { foreach (ToolStripMenuItem mainMenu in menuStrip.Items) // Disable all menus { mainMenu.Visible = false; for (int intMB = 0; intMB < mainMenu.DropDownItems.Count; intMB++) { mainMenu.DropDownItems[intMB].Visible = false; ToolStripMenuItem subMenu = (ToolStripMenuItem)mainMenu.DropDownItems[intMB]; if (subMenu.HasDropDownItems) { for (int intMSB = 0; intMSB < subMenu.DropDownItems.Count; intMSB++) { subMenu.DropDownItems[intMSB].Visible = false; ToolStripMenuItem sub2Menu = (ToolStripMenuItem)subMenu.DropDownItems[intMSB]; if (sub2Menu.HasDropDownItems) { for (int intMS2B = 0; intMS2B < sub2Menu.DropDownItems.Count; intMS2B++) { sub2Menu.DropDownItems[intMS2B].Visible = false; ToolStripMenuItem sub3Menu = (ToolStripMenuItem)sub2Menu.DropDownItems[intMS2B]; if (sub3Menu.HasDropDownItems) { for (int intMS3B = 0; intMS3B < sub3Menu.DropDownItems.Count; intMS3B++) { sub3Menu.DropDownItems[intMS3B].Visible = false; } } } } } } } } dt = objTask.Get_DMSUserTasks(CommonData.LogUserId.ToString(), CommonData.CompanyCode.ToString()).Tables[0]; if (dt.Rows.Count > 0) // Enable as DB { foreach (DataRow dataRow in dt.Rows) { string strMenu = dataRow["MenuName"].ToString(); foreach (ToolStripMenuItem mainMenu in menuStrip.Items) { //if (strMenu.IndexOf("mb") > -1) //{ if (strMenu == mainMenu.Name && dataRow["STATUS"].ToString() == "E") { mainMenu.Visible = true; //break; } for (int iMB = 0; iMB < mainMenu.DropDownItems.Count; iMB++) { if (mainMenu.DropDownItems[iMB].Name.ToString() == strMenu && dataRow["STATUS"].ToString() == "E") { mainMenu.DropDownItems[iMB].Visible = true; //this.break; } ToolStripMenuItem subMenu = (ToolStripMenuItem)mainMenu.DropDownItems[iMB]; //if (subMenu.HasDropDownItems) //{ for (int jMSB = 0; jMSB < subMenu.DropDownItems.Count; jMSB++) { if (subMenu.DropDownItems[jMSB].Name.ToString() == strMenu && dataRow["STATUS"].ToString() == "E") { subMenu.DropDownItems[jMSB].Visible = true; //break; } ToolStripMenuItem sub2Menu = (ToolStripMenuItem)subMenu.DropDownItems[jMSB]; //if (sub2Menu.HasDropDownItems) //{ for (int jMS2B = 0; jMS2B < sub2Menu.DropDownItems.Count; jMS2B++) { if (sub2Menu.DropDownItems[jMS2B].Name.ToString() == strMenu && dataRow["STATUS"].ToString() == "E") { sub2Menu.DropDownItems[jMS2B].Visible = true; //break; } ToolStripMenuItem sub3Menu = (ToolStripMenuItem)sub2Menu.DropDownItems[jMS2B]; //if (sub3Menu.HasDropDownItems) //{ for (int jMS3B = 0; jMS3B < sub3Menu.DropDownItems.Count; jMS3B++) { if (sub3Menu.DropDownItems[jMS3B].Name.ToString() == strMenu && dataRow["STATUS"].ToString() == "E") { sub3Menu.DropDownItems[jMS3B].Visible = true; //break; } ToolStripMenuItem sub4Menu = (ToolStripMenuItem)sub3Menu.DropDownItems[jMS3B]; //if (sub4Menu.HasDropDownItems) //{ for (int jMS4B = 0; jMS4B < sub4Menu.DropDownItems.Count; jMS4B++) { if (sub4Menu.DropDownItems[jMS4B].Name.ToString() == strMenu && dataRow["STATUS"].ToString() == "E") { sub4Menu.DropDownItems[jMS4B].Visible = true; //break; } } //} } //} } //} } //} } //} } } } } } catch (Exception ex) { mbExit.Visible = true; throw new Exception(ex.Message, ex); } mbExit.Visible = true; }
private void FillTasks() { objTask = new UserTaskDB(); DataTable dt = null; try { if (clbUsers.SelectedIndex > -1) { dt = objTask.UserTasks_Get(((NewCheckboxListItem)(clbUsers.SelectedItem)).Tag.ToString()).Tables[0]; TreeNode tNode1 = new TreeNode(); tNode1.Text = "Main Menu"; tNode1.Tag = "Main Menu"; treeView1.Nodes.Add(tNode1); for (int i = 0; i < dt.Rows.Count; i++) { TreeNode tNode = new TreeNode(); tNode.Text = dt.Rows[i]["Caption"].ToString(); tNode.Tag = dt.Rows[i]["VALUE_MEMBER"].ToString(); string[] strLevel = dt.Rows[i]["VALUE_MEMBER"].ToString().Split('^'); int[] arrLevel = new int[7]; for (int j = 0; j < 7; j++) { arrLevel[j] = Convert.ToInt32(strLevel[j]); } if (arrLevel[0] != 0 && arrLevel[1] == 0 && arrLevel[2] == 0 && arrLevel[3] == 0 && arrLevel[4] == 0 && arrLevel[5] == 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] == 0 && arrLevel[3] == 0 && arrLevel[4] == 0 && arrLevel[5] == 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] != 0 && arrLevel[3] == 0 && arrLevel[4] == 0 && arrLevel[5] == 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes[arrLevel[1] - 1].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] != 0 && arrLevel[3] != 0 && arrLevel[4] == 0 && arrLevel[5] == 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes[arrLevel[1] - 1].Nodes[arrLevel[2] - 1].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] != 0 && arrLevel[3] != 0 && arrLevel[4] != 0 && arrLevel[5] == 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes[arrLevel[1] - 1].Nodes[arrLevel[2] - 1].Nodes[arrLevel[3] - 1].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] != 0 && arrLevel[3] != 0 && arrLevel[4] != 0 && arrLevel[5] != 0 && arrLevel[6] == 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes[arrLevel[1] - 1].Nodes[arrLevel[2] - 1].Nodes[arrLevel[3] - 1].Nodes[arrLevel[4] - 1].Nodes.Add(tNode); } else if (arrLevel[0] != 0 && arrLevel[1] != 0 && arrLevel[2] != 0 && arrLevel[3] != 0 && arrLevel[4] != 0 && arrLevel[5] != 0 && arrLevel[6] != 0) { treeView1.Nodes[0].Nodes[arrLevel[0] - 1].Nodes[arrLevel[1] - 1].Nodes[arrLevel[2] - 1].Nodes[arrLevel[3] - 1].Nodes[arrLevel[4] - 1].Nodes[arrLevel[5] - 1].Nodes.Add(tNode); } if (dt.Rows[i]["STATUS"].ToString() == "E") { tNode.Checked = true; } else { tNode.Checked = false; } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } treeView1.Nodes[0].Expand(); treeView1.Nodes[0].Nodes[0].Expand(); }