// Configure Separation Process Stackholder public ActionResult ConfigureSeparationStackholder() { try { StackHolderVM stackHoldermodel = new StackHolderVM(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); stackHoldermodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); stackHoldermodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL employeeDAL = new EmployeeDAL(); stackHoldermodel.SearchedUserDetails.EmployeeId = employeeDAL.GetEmployeeID(employeeCode); stackHoldermodel.SearchedUserDetails.EmployeeCode = employeeCode; ConfigurationDAL dal = new ConfigurationDAL(); List <StackHolderList> stackHolder = dal.getStackHolderDetails(); stackHoldermodel.CountRecord = stackHolder.Count; stackHoldermodel.stackHolder = stackHolder; return(PartialView("_SeparationStackholder", stackHoldermodel)); } catch { throw; } }
public ActionResult ConfigureParameterCategories() { try { ConfigureParameterCategory configParametercategory = new ConfigureParameterCategory(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); configParametercategory.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); configParametercategory.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); configParametercategory.SearchedUserDetails.EmployeeId = employeeID; configParametercategory.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <Parametercompetency> parametercompetency = configDAL.GetParameterCategories(); configParametercategory.RecordsCount = parametercompetency.Count; configParametercategory.Parametercompetencys = parametercompetency; return(PartialView("_ConfigureParameterCompetency", configParametercategory)); } catch { throw; } }
public ActionResult AddParameterCompetency(int?categoryID) { try { AddNewCategory addnewcategory = new AddNewCategory(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addnewcategory.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addnewcategory.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); addnewcategory.SearchedUserDetails.EmployeeId = employeeID; PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); addnewcategory.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); if (categoryID != null) { tbl_PA_CompetencyCategories parameterCategory = configDAL.getParametercategory(categoryID); addnewcategory.CategoryID = parameterCategory.CategoryID; addnewcategory.Category = parameterCategory.CategoryType; addnewcategory.Description = parameterCategory.CategoryDescription; } return(PartialView("_addParameterCategory", addnewcategory)); } catch { throw; } }
private void updateTotalPrice(String quantity, String price, String action) { float actualQuantity = float.Parse(quantity); float actualPrice = NumberUtils.SafeParse(price); double totalPrice = actualPrice * actualQuantity; totalPrice = Math.Round(totalPrice, 2); if (action == "ADD") { this.saleTotalPrice = this.saleTotalPrice + totalPrice; this.saleCounter = this.saleCounter + actualQuantity; } else if (action == "REMOVE") { this.saleTotalPrice = this.saleTotalPrice - totalPrice; this.saleCounter = this.saleCounter - actualQuantity; } else { throw new Exception("Invalid Action"); } lblItemCount.Text = this.saleCounter.ToString(); lblTotalPrice.Text = ConfigurationDAL.GetCurrentCurrency() + " " + this.saleTotalPrice; }
public ActionResult DeleteParameter(List <int> collection) { try { bool success = false; string result = null; ConfigurationDAL configDAL = new ConfigurationDAL(); if (collection.Count != 0) { success = configDAL.DeleteParameter(collection); if (success) { result = "Deleted"; } else { result = "Error"; } } return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } catch { throw; } }
public ActionResult AddRatingScales(AddRatingScale model) { try { bool success = false; string result = null; string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); CommonMethodsDAL Commondal = new CommonMethodsDAL(); string UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL configDAL = new ConfigurationDAL(); success = configDAL.SaveRatingScales(model, UserRole); if (model.IsAddnew) { result = "addnew"; return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } else { if (success) { result = "Saved"; } else { result = "Error"; } return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } } catch { throw; } }
public ActionResult EditParameterRole(int RoleID) { try { Session["RoleID"] = RoleID; AssocieteDriverAndComepetency driverAndComeptency = new AssocieteDriverAndComepetency(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); driverAndComeptency.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); driverAndComeptency.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); driverAndComeptency.SearchedUserDetails.EmployeeId = employeeID; driverAndComeptency.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <Competencies> competency = configDAL.getCompetenciesForRole(RoleID); driverAndComeptency.CompetencyList = competency; driverAndComeptency.RecordsCount = competency.Count; driverAndComeptency.RoleID = RoleID; return(PartialView("_CompetenciesForRole", driverAndComeptency)); } catch { throw; } }
public ActionResult ConfigureEditReason(int?reasonId) { try { ExitViewModel Exitmodel = new ExitViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL EmployeeDAL = new EmployeeDAL(); Exitmodel.SearchedUserDetails.EmployeeId = EmployeeDAL.GetEmployeeID(Membership.GetUser().UserName); ConfigurationDAL dal = new ConfigurationDAL(); if (reasonId != null) { v_tbl_HR_Reasons reasonRecord = dal.getReason(reasonId); Exitmodel.Reason = reasonRecord.Reason; Exitmodel.tag = Convert.ToString(reasonRecord.TagID); Exitmodel.TagID = reasonRecord.TagID; Exitmodel.ReasonID = reasonRecord.ReasonID; } Exitmodel.ReasonID = reasonId.HasValue ? reasonId.Value : 0; return(PartialView("_ReasonDetails", Exitmodel)); } catch { throw; } }
private void frmSearchItem_Load(object sender, EventArgs e) { lblTotalProfit.Text = ConfigurationDAL.GetCurrentCurrency() + " 0.00"; try { bool isExist = ShopDAL.isItemTypeExists(); if (isExist) { ShopDAL db = new ShopDAL(); DataSet ds = db.GetItemsType(); DataRow defaultRow = ds.Tables[0].NewRow(); defaultRow["Type_ID"] = "0"; defaultRow["Name"] = "---------------- Select Item Type ----------------"; ds.Tables[0].Rows.InsertAt(defaultRow, 0); cmb_itemType.DataSource = ds.Tables[0]; cmb_itemType.DisplayMember = "Name"; cmb_itemType.ValueMember = "Type_ID"; cmb_itemType.SelectedIndex = 0; } } catch (IndexOutOfRangeException ex) { MessageBox.Show(this, "Add atleast one item type", "Error:Search Item(s)", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error:Search Item(s)", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } setupGridColumns(); setupColumnsWidth(); }
public ActionResult SaveStackHolder(string collection) { try { bool success = false; string result = null; ConfigurationDAL configDal = new ConfigurationDAL(); string roleIDWithcomma = collection.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); success = configDal.SaveStakeHolderSelected(myInts); if (success == true) { result = "Edited"; } else { result = "Added"; } return(Json(new { resultReason = result, status = success }, JsonRequestBehavior.AllowGet)); } catch { throw; } }
public ActionResult FeedbackChecklist(int OrderNumber) { exitFeedbackChecklistVM checklistModel = new exitFeedbackChecklistVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); checklistModel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); checklistModel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); if (OrderNumber != 0) { List <FeedbackChk> feedbackChk = dal.getFeedbackChklist(OrderNumber); checklistModel.feedbackChk = feedbackChk; checklistModel.CountRecord = feedbackChk.Count; foreach (var item in feedbackChk) { checklistModel.Checklist = item.Checklist; checklistModel.Name = item.Name; checklistModel.Role = item.Role; checklistModel.HiddenChecklistID = item.Checklist; checklistModel.HiddenNameID = item.EmployeeID; } } checklistModel.StageID = OrderNumber; checklistModel.checkListFor = dal.getChecklistDetails(); ViewBag.checkListFor = dal.getChecklistDetails(); List <CheckListNames> checkList = dal.getcheckListNames(); checklistModel.checkListNames = checkList; return(PartialView("_ExitFeedbackChkList", checklistModel)); }
//Configure Separation Reasons public ActionResult ConfigureSeperationReason() { try { ExitViewModel Exitmodel = new ExitViewModel(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL emmployeeDAL = new EmployeeDAL(); Exitmodel.SearchedUserDetails.EmployeeId = emmployeeDAL.GetEmployeeID(employeeCode); Exitmodel.SearchedUserDetails.EmployeeCode = employeeCode; ConfigurationDAL dal = new ConfigurationDAL(); List <SeperationReasons> seperationReason = dal.getSeperationReason(); Exitmodel.CountRecord = seperationReason.Count; Exitmodel.seperationReason = seperationReason; return(PartialView("_SeperationReasonDetails", Exitmodel)); } catch { throw; } }
public ActionResult SelectStakeholder(string collection, string searchstring) { try { string roleIDWithcomma = collection.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); StackHolderVM stackHoldermodel = new StackHolderVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); stackHoldermodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); stackHoldermodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); List <StackHolderList> stackholder = dal.getSelectedStackHolder(myInts); if (searchstring != "") { List <StackHolderList> searchStakeHolder = stackholder.FindAll(x => x.Employee.ToLower().Replace(" ", "").Contains(searchstring.ToLower().Replace(" ", ""))); stackHoldermodel.stackHolder = searchStakeHolder; stackHoldermodel.CountRecord = searchStakeHolder.Count; } else { stackHoldermodel.stackHolder = stackholder; stackHoldermodel.CountRecord = stackholder.Count; } return(PartialView("_StakeHolder", stackHoldermodel)); } catch { throw; } }
public ActionResult DeleteStackholder(string collection) { try { bool success = false; string result = null; ConfigurationDAL configDAL = new ConfigurationDAL(); if (collection != "") { string roleIDWithcomma = collection.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); foreach (var item in myInts) { success = configDAL.DeleteStackHolderRecord(item); result = "Deleted"; } } return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } catch { throw; } }
public ActionResult ConfigureParameter() { try { Session["SearchEmpFullName"] = null; // to hide emp search Session["SearchEmpCode"] = null; Session["SearchEmpID"] = null; ConfirmationViewModel confirmationmodel = new ConfirmationViewModel(); string EmployeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(EmployeeCode); confirmationmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); confirmationmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); confirmationmodel.SearchedUserDetails.EmployeeCode = EmployeeCode; EmployeeDAL DAL = new EmployeeDAL(); confirmationmodel.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(EmployeeCode); ConfigurationDAL configDAL = new ConfigurationDAL(); List <CompetencyMaster> competencyMaster = configDAL.GetCompetencyMaster(); confirmationmodel.RecordsCount = competencyMaster.Count; confirmationmodel.CompetencyMasters = competencyMaster; return(PartialView("_ConfigureParameter", confirmationmodel)); } catch { throw; } }
private void FillBoxSetTable(int boxId) { List <Tuple <string, string> > boxList = new List <Tuple <string, string> >(); BoxSet box = ConfigurationDAL.GetBoxSetById(boxId); Cpu cp = ConfigurationDAL.GetCpulById(box.cupId); Hdd hdd = ConfigurationDAL.GetHddlById(box.hddId); VideoCard video = ConfigurationDAL.GetVideoCardlById(box.videoCardId); boxList.Add(new Tuple <string, string>("номер", box.id.ToString())); boxList.Add(new Tuple <string, string>("процесор", cp.name)); boxList.Add(new Tuple <string, string>("процесорен производител", cp.producer)); boxList.Add(new Tuple <string, string>("дъно", box.motherboard)); boxList.Add(new Tuple <string, string>("рам", box.ram)); boxList.Add(new Tuple <string, string>("видео карта", video.name)); boxList.Add(new Tuple <string, string>("производител на видео карта", video.producer)); boxList.Add(new Tuple <string, string>("охлаждане", box.coolingSystem)); boxList.Add(new Tuple <string, string>("захранване", box.powerSupply)); boxList.Add(new Tuple <string, string>("лан карта", box.expansionCards)); boxList.Add(new Tuple <string, string>("хард диск", hdd.name)); boxList.Add(new Tuple <string, string>("производител на хард диск", hdd.producer)); boxList.Add(new Tuple <string, string>("преносими устройства", box.removableDevices)); boxList.Add(new Tuple <string, string>("кутия", box.box)); BoxSetGrid.DataSource = boxList; BoxSetGrid.DataBind(); }
public ActionResult AddRatingScales(int?RatingID) { try { AddRatingScale addNewRating = new AddRatingScale(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addNewRating.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addNewRating.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); addNewRating.SearchedUserDetails.EmployeeId = employeeID; PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); addNewRating.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); if (RatingID != null) { tbl_PA_Rating_Master ratingScale = configDAL.getRatingScaleDetails(RatingID); addNewRating.Percentage = ratingScale.Percentage; addNewRating.Rating = ratingScale.Rating; addNewRating.RatingID = ratingScale.RatingID; addNewRating.Description = ratingScale.Description; addNewRating.AdjustmentFactor = ratingScale.AdjustmentFactor; addNewRating.SetAsMinimumLimit = ratingScale.SetAsMinimumLimit.HasValue ? ratingScale.SetAsMinimumLimit.Value : false; } return(PartialView("_addRatingScale", addNewRating)); } catch { throw; } }
public IActionResult Sincronize() { ConfigurationDAL.sincronizeOdooContacts(); int response = 1; return(RedirectToAction("Index", new { response })); }
public ActionResult ConfigureParametersRoles(string searchstring) { try { ConfigureParametersforRoles parameterRoles = new ConfigureParametersforRoles(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); parameterRoles.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); parameterRoles.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); parameterRoles.SearchedUserDetails.EmployeeId = employeeID; parameterRoles.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <RoleLists> roleList = configDAL.getAllRoles(); if (searchstring != null) { List <RoleLists> roleListwithsearch = roleList.FindAll(x => x.RoleDescription.ToLower().Contains(searchstring.ToLower())); parameterRoles.RoleList = roleListwithsearch; parameterRoles.RecordsCount = roleList.Count; } else { parameterRoles.RoleList = roleList; parameterRoles.RecordsCount = roleList.Count; } return(PartialView("_ConfigureParameterRole", parameterRoles)); } catch { throw; } }
public ActionResult AddParameter(addParameter model) { try { bool success = false; string result = null; int OrderNumber = 0; ConfigurationDAL configDAL = new ConfigurationDAL(); success = configDAL.SaveParameter(model); if (model.IsAddnew) { result = "addnew"; return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } else { if (success) { result = "Saved"; OrderNumber = model.OrderNo.HasValue ? model.OrderNo.Value : 0; } else { result = "Error"; } return(Json(new { resultMesssage = result, status = success, orderNumber = OrderNumber }, JsonRequestBehavior.AllowGet)); } } catch { throw; } }
public ActionResult AddParameter(int?orderID) { addParameter addparameter = new addParameter(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addparameter.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addparameter.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); addparameter.SearchedUserDetails.EmployeeCode = Membership.GetUser().UserName; EmployeeDAL DAL = new EmployeeDAL(); addparameter.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(Membership.GetUser().UserName); ConfigurationDAL configDAL = new ConfigurationDAL(); if (orderID != null) { tbl_PA_Competency_Master competencyMaster = configDAL.getParameter(orderID); addparameter.Parameter = competencyMaster.Competency; addparameter.OrderNo = competencyMaster.OrderNo; addparameter.category = Convert.ToString(competencyMaster.CategoryID); addparameter.BehavioralIndicators = competencyMaster.BehavioralIndicators; addparameter.Description = competencyMaster.Description; addparameter.CompetencyID = competencyMaster.CompetencyID; } addparameter.CategoryList = configDAL.getCategoryList(); return(PartialView("_addParameter", addparameter)); }
public ActionResult AddParameterCompetency(AddNewCategory addnewcategory) { try { bool success = false; string result = null; ConfigurationDAL configDAL = new ConfigurationDAL(); success = configDAL.SaveParameterCategory(addnewcategory); if (addnewcategory.IsAddnew) { result = "addnew"; return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } else { if (success) { result = "Saved"; } else { result = "Error"; } return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } } catch { throw; } }
private void btn_Login_Click(object sender, EventArgs e) { String username = txtUsername.Text; String password = SecuirtyUtil.encodePassword(txtPassword.Text); String currentPassword = ConfigurationDAL.GetAdministratorPassword(); if (username == ConfigurationDAL.ADMINISTRATOR) { if (password == currentPassword) { gpAuthenticate.Hide(); lblAuthenticationStatus.Text = "Authentication Passed"; lblAuthenticationStatus.Show(); //frmSearchSales frmSearch = new frmSearchSales(); //frmSearch.ShowDialog(); authenticated = true; this.Close(); } else { MessageBox.Show(this, "Incorrect Username or Password", "Login Form", MessageBoxButtons.OK, MessageBoxIcon.Stop); //this.Close(); } } else { MessageBox.Show(this, "Incorrect Username or Password", "Login Form", MessageBoxButtons.OK, MessageBoxIcon.Stop); //this.Close(); } }
private void btnPaid_Click(object sender, EventArgs e) { try { long moneyPaid = long.Parse(txtMoneyPaid.Text); double changeToBeGiven = moneyPaid - this.subTotal; if (moneyPaid >= this.subTotal) { lblTotalGiven.Text = ConfigurationDAL.GetCurrentCurrency() + moneyPaid.ToString(); lblChangeToBePaid.Text = ConfigurationDAL.GetCurrentCurrency() + changeToBeGiven.ToString(); btnChangeGiven.Enabled = true; picStatusPayment.Image = global::Shop_Management_Solution.Properties.Resources._1_euro_rotating_lg_nwm1; lastInvoiceID = 0; if (changeToBeGiven > 0) { lblPaymentStatusText.Text = "Money Paid. Give change! "; lblPaymentStatusText.ForeColor = Color.Green; } else { lblPaymentStatusText.Text = "No! Change to give back"; lblPaymentStatusText.ForeColor = Color.ForestGreen; btnChangeGiven.Text = "Move to next"; } } else { throw new Exception("Money can't be less then bill"); } } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error: Money Paid", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ActionResult ConfigureSeparationEditCheckList(int?QuestionnaireID) { try { ExitViewModel Exitmodel = new ExitViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); if (QuestionnaireID != null) { ExitViewModel SeperationCheckList = dal.getCheckList(QuestionnaireID); Exitmodel.QuestionnaireID = SeperationCheckList.QuestionnaireID; Exitmodel.QuestionnaireName = SeperationCheckList.QuestionnaireName; Exitmodel.QuestionnaireDescription = SeperationCheckList.QuestionnaireDescription; Exitmodel.TagID = SeperationCheckList.TagID; Exitmodel.RevisionID = SeperationCheckList.RevisionID; Exitmodel.RevisionNo = SeperationCheckList.RevisionNo; Exitmodel.Reason = SeperationCheckList.Reason; } List <ReasonDetail> Q_Questionnaire_Revision = dal.getReasonList(); Exitmodel.ReasonList = Q_Questionnaire_Revision; return(PartialView("_CheckListDetails", Exitmodel)); } catch { throw; } }
public ActionResult UpdateEmployeeNodeMapping(string[] allEmployeeNodeList) { try { bool status = false; string resultMessage = string.Empty; if (allEmployeeNodeList != null) { ConfigurationDAL configDAL = new ConfigurationDAL(); status = configDAL.UpdateEmployeeNodeMapping(allEmployeeNodeList); if (status) { resultMessage = "Saved"; } else { resultMessage = "Error"; } } return(Json(new { results = resultMessage, status = status }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { status = "Error" }, JsonRequestBehavior.AllowGet)); } }
private void frmSaleItem_Load(object sender, EventArgs e) { try { bool isExist = ShopDAL.isItemTypeExists(); if (isExist) { ShopDAL db = new ShopDAL(); DataSet ds = db.GetItemsType(); //Creating dictionary to handle available quantity of all items. It's made of pair (Type_ID, Quantity) quantitiesLeft = new Dictionary <string, string>(); foreach (DataRow dr in ds.Tables[0].Rows) { quantitiesLeft.Add(dr["Type_ID"].ToString(), ShopDAL.getStockInHandQuantity(long.Parse(dr["Type_ID"].ToString())).ToString()); } // Inserting Default Row for Selection DataRow defaultRow = ds.Tables[0].NewRow(); defaultRow["Type_ID"] = "0"; defaultRow["Name"] = "---------------- Select Item Type ----------------"; ds.Tables[0].Rows.InsertAt(defaultRow, 0); cmb_itemType.DataSource = ds.Tables[0]; cmb_itemType.DisplayMember = "Name"; cmb_itemType.ValueMember = "Type_ID"; cmb_itemType.SelectedIndex = 0; cmb_itemType.AutoCompleteMode = AutoCompleteMode.Append; cmb_itemType.AutoCompleteSource = AutoCompleteSource.ListItems; lstView_sales.Columns[0].Width = 0; lblItemCount.Text = "0"; lblTotalPrice.Text = ConfigurationDAL.GetCurrentCurrency() + " 0.00"; txtSalePrice.Text = "0"; } } catch (IndexOutOfRangeException ex) { MessageBox.Show(this, "Add atleast one item type to Sale Item(s)", "Error:Sale Item(s)", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error:Sale Item(s)", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } //string[] row1 = { "CD-Software", "2", "30" }; //string[] row2 = { "CD-Software", "2", "30" }; /*lstView_sales.Items.Add("1").SubItems.AddRange(row1); * lstView_sales.Items.Add("1").SubItems.AddRange(row2); * * foreach(ListViewItem lvi in lstView_sales.Items) * { * MessageBox.Show(lvi.SubItems[3].Text); * }*/ }
private void btnSave_Click(object sender, EventArgs e) { string currencySymbol = txtCurrencySybmol.Text; string shopName = txtShopName.Text; string shopAddress = txtAddress.Text; try { if (String.IsNullOrEmpty(currencySymbol) || String.IsNullOrEmpty(currencySymbol)) { MessageBox.Show(this, "Fill in currency symbol", "Error: Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (String.IsNullOrEmpty(shopName) || String.IsNullOrEmpty(shopName)) { MessageBox.Show(this, "Fill in Shop name", "Error: Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (String.IsNullOrEmpty(shopAddress) || String.IsNullOrEmpty(shopAddress)) { MessageBox.Show(this, "Fill in Shop Address", "Error: Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { bool isInserted = ConfigurationDAL.UpdateConfigurationByName(ConfigurationDAL.CURRENCY, currencySymbol); isInserted = ConfigurationDAL.UpdateConfigurationByName(ConfigurationDAL.SHOPNAME, shopName); isInserted = ConfigurationDAL.UpdateConfigurationByName(ConfigurationDAL.ADDRESS, shopAddress); string defaultFileName = System.Reflection.Assembly.GetExecutingAssembly().Location; string directory = System.IO.Path.GetDirectoryName(defaultFileName); string defaultPath = directory + "\\Images\\Header.JPG"; string currentFile = txtFileImage.Text.ToString(); if (!defaultPath.Equals(currentFile)) { if (File.Exists(defaultPath)) { File.Delete(defaultPath); } Bitmap newImage = new Bitmap(currentFile); // ImageUtilities.ResizeImage(new Bitmap(currentFile), 220, 33); ImageUtilities.SaveJpeg(defaultPath, newImage, 100); } if (isInserted) { this.Close(); MessageBox.Show(this, "Settings updated successfully.", "Settings", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(this, "Settings updation failed.", "Error:Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error: Settings", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void currencySettingToolStripMenuItem_Click(object sender, EventArgs e) { frmSettings frmCurrency = new frmSettings(); frmCurrency.ShowDialog(); lblTotalGiven.Text = ConfigurationDAL.GetCurrentCurrency() + " 0.00"; lblTotalPrice.Text = ConfigurationDAL.GetCurrentCurrency() + " 0.00"; lblChangeToBePaid.Text = ConfigurationDAL.GetCurrentCurrency() + " 0.00"; }
private void readInvoiceHead() { dateOfSale.Format = DateTimePickerFormat.Long; String displayDate = dateOfSale.Text; //Titles and Image of invoice: invoiceTitle = ConfigurationDAL.GetShopName(); // "International Food Company"; invoiceSubTitle1 = "Address:" + ConfigurationDAL.GetCurrentAddress() + "\nDated :" + displayDate.ToString(); invoiceImage = Application.StartupPath + @"\Images\" + "Header.jpg"; }