public ActionResult DeleteProducts(int productId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ProductsDataService dataService = new ProductsDataService(); try { dataService.DeleteProducts(productId); return RedirectToAction("Edit", "Products"); } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditService(int id) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ServicesModel model = new ServicesModel(); ServicesDataService dataservice = new ServicesDataService(); try { model = dataservice.GetServicesModelByServiceId(id); return View(model); } catch (Exception ex) { throw ex; } finally { model = null; dataservice = null; } }
public ActionResult Edit() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; PromoDataService dataService = new PromoDataService(); PromoViewModel viewModel = new PromoViewModel(); try { viewModel.PromoModel = dataService.GeneratePromoModel(); return View(viewModel); } catch (Exception ex) { throw ex; } finally { dataService = null; viewModel = null; } }
public CommonModel GenerateCommonModel() { try { CommonModel model = new CommonModel(); ContactDataService cds = new ContactDataService(); model.FaceBook = cds.GenerateSocialMediaModelById(1).SocialMediaUrl; model.Twitter = cds.GenerateSocialMediaModelById(2).SocialMediaUrl; model.Youtube = cds.GenerateSocialMediaModelById(3).SocialMediaUrl; model.Instagram = cds.GenerateSocialMediaModelById(4).SocialMediaUrl; model.PhoneNumber = cds.GenerateContactNumbersModelById(1).ContactNumber; model.Email = cds.GenerateEmailAddressModelById(1).EmailAddress; model.ShoppingHours = cds.GenerateShoppingHoursModelById(1).ShoppingHours; return model; } catch (Exception ex) { throw ex; } }
//构造方法 public ManagementService() { try { //获取token string token = FinanceToken.getFinanceCheckToken().getToken(); //获取对象 account = FinanceToken.getFinanceCheckToken().checkToken(token); //实例化model层 commonModel = new CommonModel(); }catch { throw new InvalidOperationException("身份验证不通过"); } }
public async Task <ActionResult> Edit(int?courierId) { using (var con = new SqlConnection(_connectionString)) { var folder = "/UploadedImages/Courier/"; var result = con.Query <ManageCourierModel>("SELECT * from Courier_Master WHERE CourierId=@CourierId", new { CourierId = courierId }, commandType: CommandType.Text).FirstOrDefault(); result.UploadedCourierFileUrl = folder + "Logo/" + result.UploadedCourierFile; result.UploadedGSTFileUrl = folder + "Gst/" + result.UploadedGSTFile; result.UserPANCardFileUrl = folder + "PanCards/" + result.UserPANCardFile; result.VoterIDFileUrl = folder + "VoterCards/" + result.VoterIDFile; result.AadhaarCardFileUrl = folder + "AdharCards/" + result.AadhaarCardFile; result.AgreementScanFileUrl = folder + "ScanAgreement/" + result.AgreementScanFile; result.CancelledChequeFileUrl = folder + "CancelledCheques/" + result.CancelledChequeFile; if (result != null) { result.Country = result.CountryId; result.StateDropdown = result.StateId; result.CityDropdown = result.CityId; result.PinCodeDropdown = result.Pincode; result.SC_CountryDropdown = result.SC_Country; result.PersonCountryDropdown = result.PersonCountry; result.PersonCityDropdown = result.PersonCity; result.PersonStateDropdown = result.PersonState; result.SC_PincodeDropdown = result.SC_Pincode; string volume = result.Volume.ToString(); result.CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); result.StateList = new SelectList(dropdown.BindState(), "Value", "Text"); result.CityList = new SelectList(dropdown.BindLocation(), "Value", "Text"); result.PincodeList = new SelectList(dropdown.BindPincodeListByCountry(Convert.ToInt32(result.SC_Country)), "Value", "Text"); result.ApplicableTaxTypeList = new SelectList(await CommonModel.GetApplicationTaxType(), "Value", "Text"); result.PersonAddressTypeList = new SelectList(CommonModel.GetAddressTypes(), "Value", "Text"); result.AWBNumberUsedList = new SelectList(await CommonModel.GetAWBNumberUsedTypes(), "Value", "Text"); result.AgreementSignupList = new SelectList(await CommonModel.GetAgreementSignup(), "Value", "Text"); result.LegalDocumentVerificationList = new SelectList(await CommonModel.GetLegalDocumentVerification(), "Value", "Text"); string[] parts = volume.ToString().Split('-'); result.Volumn1 = parts[0]; result.Volumn2 = parts[1]; string weight = result.WeightRange.ToString(); string[] parts1 = weight.ToString().Split('-'); result.WeightRange1 = parts[0]; result.WeightRange2 = parts[1]; result.AgreementEndDate = Convert.ToDateTime(result.AgreementEndDate).ToString("MM-dd-yyyy"); result.AgreementStartDate = Convert.ToDateTime(result.AgreementStartDate).ToString("MM-dd-yyyy"); result.ApplicableFromDate = Convert.ToDateTime(result.ApplicableFromDate).ToString("MM-dd-yyyy"); } return(View(result)); } }
public async Task <ActionResult> Index() { ViewBag.PageNumber = (Request.QueryString["grid-page"] == null) ? "1" : Request.QueryString["grid-page"]; bool IsClient = false; var filter = new FilterModel { CompId = CurrentUser.CompanyId }; if (CurrentUser.UserTypeName.ToLower().Contains("client")) { filter.ClientId = CurrentUser.RefKey; filter.RefKey = CurrentUser.RefKey; IsClient = true; } var clientData = new MainClientDataModel(); var serviceType = await CommonModel.GetServiceType(filter); var deliveryType = await CommonModel.GetDeliveryServiceType(filter); clientData.Client = new FileDetailModel(); clientData.Client.IsClient = IsClient; clientData.Client.ClientId = filter.ClientId; clientData.Client.ClientList = new SelectList(await CommonModel.GetClientData(CurrentUser.CompanyId), "Name", "Text"); clientData.Client.ServiceTypeList = new SelectList(serviceType, "Value", "Text"); clientData.Client.DeliveryTypeList = new SelectList(deliveryType, "Value", "Text"); // new call Log clientData.NewCallLog = new CallDetailsModel { DataSourceId = 101, IsAssingedCall = true, ClientList = clientData.Client.ClientList, ServiceTypeList = clientData.Client.ServiceTypeList, DeliveryTypeList = clientData.Client.DeliveryTypeList, BrandList = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"), CategoryList = new SelectList(_dropdown.BindCategory(filter), "Value", "Text"), SubCategoryList = new SelectList(Enumerable.Empty <SelectListItem>()), ProductList = new SelectList(Enumerable.Empty <SelectListItem>()), CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text"), ConditionList = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text"), IsClient = IsClient, StatusList = new SelectList(await CommonModel.GetStatusTypes("Client"), "Value", "Text"), // address=new AddressDetail //{ AddressTypelist = new SelectList(await CommonModel.GetLookup("ADDRESS"), "Value", "Text"), LocationList = new SelectList(Enumerable.Empty <SelectListItem>()), // } }; clientData.tab_index = "tab-5"; return(View(clientData)); }
public ActionResult AddImages() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; CarouselsHelper carHelp = new CarouselsHelper(); try { string homeImage = (string)Request.Form["home_image"]; if (carHelp.GenerateCarousels().Count >= 3) { return(RedirectToAction("Edit", "Home")); } WebImage photo = null; var newFileName = ""; var imagePath = ""; photo = WebImage.GetImageFromRequest(); if (photo != null) { newFileName = Guid.NewGuid().ToString() + "_" + Path.GetFileName(photo.FileName); imagePath = @"Contents\Images\Home\" + newFileName; photo.Save(@"~\" + imagePath); carHelp.InsertCarousels(imagePath); ViewBag.Notification = homeImage; } return(RedirectToAction("Edit", "Home")); } catch (Exception ex) { throw ex; } finally { carHelp = null; } }
// GET: Liveboard public ActionResult Index([Bind(Include = "SelectedMode,SelectedCapdo,SelectedGiaTriCapDo,SelectedCongDoan")] FilterCoditionModel FilterCodition) { var CurrentUser = Session["Username"] as BI_USER; if (CurrentUser == null) { return(RedirectToAction("Index", "Login")); } string strResult = String.Empty; using (TKTDSXEntities dc = new TKTDSXEntities()) { CommonModel cm = new CommonModel(); try { //get user login FilterCodition.MANDT = CurrentUser.MANDT; FilterCodition.SYSID = CurrentUser.SYSID; //add mode view //get data of current date FilterCodition.DateFrom = DateTime.Now; FilterCodition.DateTo = DateTime.Now; strResult = cm.GetPhanQuyen(ref FilterCodition, CurrentUser.Username); ViewBag.SelectedCapDo = FilterCodition.ListCapDo; ViewBag.SelectedGiaTriCapDo = FilterCodition.ListGiaTriCapDo; ViewBag.GiatriCapDo = FilterCodition.SelectedGiaTriCapDo; //lay danh sach cong doan cm.GetCongDoanAll(ref FilterCodition); ViewBag.SelectedCongDoan = FilterCodition.ListCongDoan; cm.getModeView(ref FilterCodition); ViewBag.SelectedMode = FilterCodition.ListModeView; return(View("Index", FilterCodition)); } catch (Exception ex) { ViewBag.MessagePQ = "Chưa được cấp quyền" + ex.Message; return(View()); } } }
public ActionResult CreateSupplyChain(int RequestId, int NumberTrans, string Partial) { if (Session["TrackerUserId"] == null) { return(RedirectToAction("Index", "Account")); } int userid = Convert.ToInt32(Session["TrackerUserId"]); CommonModel comolList = new CommonModel(); comolList.RequestCodId = RequestId; comolList.NoOfTransections = NumberTrans; return(PartialView(Partial, comolList)); }
public async Task <ActionResult> Index() { var filter = new FilterModel { CompId = CurrentUser.CompanyId }; ManagePageContentsModel PageContentModel = new ManagePageContentsModel(); PageContentModel.MainContent = await _PageContent.GetAllPageContent(filter); PageContentModel.DynamicContent = new ManagePageContentsModel(); PageContentModel.DynamicContent.PageNameList = new SelectList(await CommonModel.GetLookup("Page"), "Value", "Text"); PageContentModel.DynamicContent.SectionNameList = new SelectList(Enumerable.Empty <SelectList>()); return(View(PageContentModel)); }
//构造方法 public VoucherWordService() { try { //获取token string token = FinanceToken.getFinanceCheckToken().getToken(); //获取对象 account = FinanceToken.getFinanceCheckToken().checkToken(token); //实例化model层 voucherWordModel = new VoucherWordModel(); commonModel = new CommonModel(); }catch { throw new Exception("身份验证不通过"); } }
internal static SkillResponse CommonModelToAlexa(CommonModel commonModel) { var response = new SkillResponse() { Version = "1.0", Response = new ResponseBody() }; response.Response.OutputSpeech = new PlainTextOutputSpeech { Text = commonModel.Response.Text }; return(response); }
internal static CommonModel ApiAiToCommonModel(AIResponse aiResponse) { var commonModel = new CommonModel() { Id = aiResponse.Id }; commonModel.Session.Id = aiResponse.SessionId; commonModel.Request.Intent = aiResponse.Result.Metadata.IntentName; commonModel.Request.Parameters = aiResponse.Result.Parameters.ToList() .ConvertAll(p => new KeyValuePair <string, string>(p.Key, p.Value.ToString())); return(commonModel); }
public virtual void Init(CharacterConfigInfo cInfos, Action createComplete = null) { IsCreate = false; onCreateComplete = createComplete; characterConfigInfo = cInfos; if (Model != null) { Model.Destroy(); Model = null; } Model = new CommonModel(); modelName = characterConfigInfo.ModelName; Model.Init(GameConst.CharacterModelABDirectory + modelName, modelName, OnCreateCompleteHandler); }
/// <summary> /// 添加 /// </summary> /// <returns></returns> public ActionResult Add() { InterfaceUserService _userService = new UserService(); var _user = _userService.Find(User.Identity.Name); CommonModel _cModel = new CommonModel(); _cModel.Consultation = new Consultation() { Email = _user.Email, IsPublic = true, Name = _user.DisplayName }; _user = null; _userService = null; return(View(_cModel)); }
protected void Page_Load(object sender, EventArgs e) { Session["UrlReferrer"] = "index.aspx"; var sql = "select * from product where showinhomepage = 1 and categoryid = " + ((int)category.资料下载).ToString() + " and (deleted <> 1 or deleted is null) and showinhomepage = 1 limit 0,10;"; sqlCmd.CommandText = sql; IDataReader reader = sqlCmd.ExecuteReader(); downloadList = new List <CommonModel>(); while (reader.Read()) { var Product = new CommonModel(); Product.id = reader["id"].ToString(); Product.categoryid = ToInt(reader["categoryid"]); Product.typeid = ToInt(reader["typeid"]); Product.title = reader["title"].ToString(); if (Session["duser"] == null) { Product.video = "login.aspx"; client = "login.aspx"; } else { Product.video = reader["video"].ToString(); client = "video/优智点读笔客户端.rar"; } downloadList.Add(Product); } reader.Close(); sql = "select * from product where showinhomepage = 1 and categoryid = " + ((int)category.首页视频).ToString() + " and (deleted <> 1 or deleted is null) and showinhomepage = 1 order by datetime desc limit 0,1;"; sqlCmd.CommandText = sql; reader = sqlCmd.ExecuteReader(); myVideo = new CommonModel(); if (reader.Read()) { myVideo.id = reader["id"].ToString(); myVideo.categoryid = ToInt(reader["categoryid"]); myVideo.typeid = ToInt(reader["typeid"]); myVideo.title = reader["title"].ToString(); myVideo.picture = reader["picture"].ToString(); myVideo.video = reader["video"].ToString(); } else { myVideo.picture = "images/xc_video.jpg"; } reader.Close(); }
public async Task <ActionResult> AddOrEditCompany(CompanyModel comp) { comp.CreatedBy = CurrentUser.UserId; if (comp.CompanyLogo != null && comp.CompanyPath != null) { if (System.IO.File.Exists(Server.MapPath(_path + "Logo/" + comp.CompanyLogo))) { System.IO.File.Delete(Server.MapPath(_path + "Logo/" + comp.CompanyLogo)); } } if (comp.CompanyPath != null) { comp.CompanyLogo = SaveImageFile(comp.CompanyPath, "Logo"); } var response = await _compRepo.AddUpdateDeleteCompany(comp); comp.ActiveTab = "tab-2"; TempData["response"] = response; comp.CompanyId = new Guid(response.result); comp.CompanyTypeList = new SelectList(await CommonModel.GetLookup("Company Type"), "Value", "Text"); comp.Organization.GstCategoryList = new SelectList(await CommonModel.GetGstCategory(), "Value", "Text"); comp.Organization.AplicationTaxTypeList = new SelectList(await CommonModel.GetLookup("Application Tax Type"), "Value", "Text"); comp.Organization.StatutoryList = new SelectList(await CommonModel.GetLookup("Statutory Type"), "Value", "Text"); comp.BankDetail.BankList = new SelectList(await CommonModel.GetLookup("Bank"), "Value", "Text"); comp.Contact.AddressTypelist = new SelectList(await CommonModel.GetLookup("Address"), "value", "Text"); comp.Contact.CountryList = new SelectList(_dropdown.BindCountry(), "Value", "Text"); comp.Contact.StateList = new SelectList(Enumerable.Empty <SelectList>()); comp.Contact.CityList = new SelectList(Enumerable.Empty <SelectList>()); comp.Contact.LocationList = new SelectList(_dropdown.BindLocation(), "Value", "Text"); comp.Agreement.ServiceList = await CommonModel.GetServiceType(new FilterModel { CompId = comp.CompanyId }); comp.Agreement.DeliveryServiceList = await CommonModel.GetDeliveryServiceType(new FilterModel { CompId = comp.CompanyId }); if (comp.Action == 'I') { comp.ActiveTab = "tab-2"; comp.Organization.RefKey = comp.CompanyId; TempData["Comp"] = comp; TempData.Keep("Comp"); return(View("Create", comp)); } else { comp = await GetCompany(comp.CompanyId); comp.ActiveTab = "tab-2"; return(View("Edit", comp)); } }
public ActionResult EditContactAdditional(int contactAdditionalId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { ContactAdditionalModel model = new ContactAdditionalModel(); model = dataService.GenerateContactAdditionalModelById(1); return(View(model)); //string id = (string)Request.Form["id"]; //if (ModelState.IsValid) //{ // dataService.UpdateContactAdditional(int.Parse(id), "", model.ContactAdditionalModel.ContactDescription); // return RedirectToAction("Edit", "Contact"); //} //else //{ // model = new ContactViewModel(); // model.ContactAdditionalModel = new Models.ContactAdditionalModel(); // model.ContactAdditionalModel.ContactAdditionalId = int.Parse(id); // model.ContactAdditionalModel.ContactDescription = model.ContactAdditionalModel.ContactDescription; // return View(model.ContactAdditionalModel); //} } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult Index() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { string body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p> <br/><p>{3}</p><p>{4}</p>"; string name = (string)Request.Form["contact_name"]; string email = (string)Request.Form["contact_email"]; string company = (string)Request.Form["contact_company"]; string phone = (string)Request.Form["contact_phone"]; string subject = (string)Request.Form["contact_subject"]; string message = (string)Request.Form["contact_message"]; // Create the email object first, then add the properties. SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo(dataService.GenerateEmailAddressModelById(1).EmailAddress); myMessage.From = new MailAddress(email, name); myMessage.Subject = subject; myMessage.Html = string.Format(body, name, email, message, company, phone); // Create credentials, specifying your user name and password. var credentials = new NetworkCredential("*****@*****.**", "Passw0rd123##"); // Create an Web transport for sending email. var transportWeb = new Web(credentials); // Send the email, which returns an awaitable task. transportWeb.DeliverAsync(myMessage); return(RedirectToAction("Sent")); } catch (System.Exception ex) { throw ex; } }
public string insert(CommonModel t12017) { string user = t12017.T_ENTRY_USER; string msg = ""; //string time = DateTime.Now.TimeOfDay.Hours + DateTime.Now.TimeOfDay.Minutes.ToString(); int stts = 0; stts = Int32.Parse(Query($"SELECT NVL(T_BLOOD_DONATION_STATUS,0) T_BLOOD_DONATION_STATUS FROM T12017 WHERE T_REQUEST_ID={t12017.T_REQUEST_ID}").Rows[0]["T_BLOOD_DONATION_STATUS"].ToString()); if (stts < 2) { BeginTransaction(); if (Command($"UPDATE T12017 SET T_UPD_USER='******',T_UPD_DATE=TRUNC(SYSDATE),T_BLOOD_DONATION_STATUS='{t12017.T_BLOOD_DONATION_STATUS}',T_RESEARCH_STTS='{t12017.T_RESEARCH_STTS}' WHERE T_REQUEST_ID={ t12017.T_REQUEST_ID}")) { CommitTransaction(); msg = "N0041"; } else { RollbackTransaction(); msg = "N0072"; } } else { msg = "N0076"; } //if (update17) //{ // int a = 0; // int b = t12071.Count; // foreach (CommonModel t71 in t12071) // { // t71.T_REQUEST_ID = t12017.T_REQUEST_ID; // // int ques = Int32.Parse(Query($"SELECT NVL(MAX(T_QUES_ID), 0) + 1 T_QUES_ID FROM T12071").Rows[0]["T_QUES_ID"].ToString()); // bool insert71= Command($"INSERT INTO T12071 (T_ENTRY_USER,T_ENTRY_DATE,T_ENTRY_TIME,T_DONOR_ID,T_DONOR_PATNO,T_DONOR_EPISODE,T_QNO,T_QNO_ANS,T_QHEAD_NO,T_DISP_SEQ,T_DIFFERAL_DAY,T_REQUEST_ID) VALUES ('{user}',TRUNC(SYSDATE),'{time}','{t71.T_DONOR_ID}','{t71.T_DONOR_PATNO}','{t71.T_DONOR_EPISODE}','{t71.T_QNO}','{t71.T_QNO_ANS}','{t71.T_QHEAD_NO}','{t71.T_DISP_SEQ}',{t71.T_DIFFERAL_DAY},{t71.T_REQUEST_ID})"); // a = insert71 ? a + 1 : a; // } // count = a == b && a > 0; //} //if (count) //{ //} return(msg); }
public ActionResult ViewExpense(int Id) { ViewBag.FILE = CreatDirectoryClass.GetFileDirectiory(Id, "Expense"); int CompanyId = 0; ExpenseViewModel experviewModel = new ExpenseViewModel(); try { ViewBag.VatDrop = GetVatList(); if (Session["CompayID"] != null) { CompanyId = Convert.ToInt32(Session["CompayID"]); } HttpResponseMessage responseCompany = GlobalVeriables.WebApiClient.GetAsync("APIComapny/" + CompanyId.ToString()).Result; MVCCompanyInfoModel companyModel = responseCompany.Content.ReadAsAsync <MVCCompanyInfoModel>().Result; CommonModel commonModel = new CommonModel(); commonModel.Name = "Expense"; ViewBag.commonModel = commonModel; ViewBag.Companydata = companyModel; HttpResponseMessage Expense = GlobalVeriables.WebApiClient.GetAsync("GetExpenseById/" + Id).Result; experviewModel = Expense.Content.ReadAsAsync <ExpenseViewModel>().Result; HttpResponseMessage expenseDetail = GlobalVeriables.WebApiClient.GetAsync("GetExpenseDetailById/" + Id).Result; List <ExpenseViewModel> ExpenseDetailList = expenseDetail.Content.ReadAsAsync <List <ExpenseViewModel> >().Result; HttpResponseMessage response = GlobalVeriables.WebApiClient.GetAsync("GetExpense/" + CompanyId).Result; List <MVCAccountTableModel> AccountmodelObj = response.Content.ReadAsAsync <List <MVCAccountTableModel> >().Result; ViewBag.Accounts = AccountmodelObj; ViewBag.ExpenseDetail = ExpenseDetailList; ViewBag.AccountId = experviewModel.ACCOUNT_ID; ViewBag.Ref = experviewModel.REFERENCEno; ViewBag.Date = experviewModel.AddedDate; ViewBag.VenderId = experviewModel.VENDOR_ID; return(View(experviewModel)); } catch (Exception) { throw; } }
static LogHelper() { XDocument config = XDocument.Load("ApplicationConfig.xml"); CommonModel commonModel = ReadIhasFileData.getInstance(); string stationNumber = commonModel.Station; string filePath = Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName; string _appDir = Path.GetDirectoryName(filePath); log4net.GlobalContext.Properties["LogPath"] = @"C:\DMS_Log";//_appDir + @"\log"; log4net.GlobalContext.Properties["LogName"] = stationNumber + "_1.log"; log4net.Config.XmlConfigurator.Configure(); localLog = log4net.LogManager.GetLogger("loggerLog4Net"); Info("Application start..."); Info(config); }
internal static CommonModel Process(CommonModel commonModel) { if (commonModel.Request.Channel == "alexa") { commonModel.Response.Text = "Hi there, would you like to find a provider?"; commonModel.Response.Prompt = "Would you like to find a provider? Please say yes or no."; } else { commonModel.Response.Text = "Hi google, would you like to find a provider?"; commonModel.Response.Prompt = "Would you like to find a provider? Please say yes or no."; } commonModel.Session.EndSession = false; return(commonModel); }
/// <summary> /// 取得oracle table 的column 相關資訊 /// </summary> /// <param name="tablename">表單名稱</param> /// <returns></returns> public IEnumerable <ColumnModel> GetModel(CommonModel param) { String strcmd = "SELECT t.Table_Name ,t.column_name,t.Data_Type,t.Data_Length FROM all_tab_cols t WHERE 1=1 "; strcmd += (String.IsNullOrEmpty(param.Table_Name))?"":" and table_name = :table_name "; using (OracleConnection conn = new OracleConnection(param.ConnectionString)) { try { return(conn.Query <ColumnModel>(strcmd, param)); } catch (Exception exp) { throw exp; } } }
public ModelT4(CommonModel model, ref string err) { this.modelcommon = model; try { Dao.Dao testconn = new Dao.Dao(); Type type = Type.GetType("ModelHalper.Dao.Dao" + model.DBType); testconn.SQL = (IDao)Activator.CreateInstance(type); col = testconn.GetColumn(model); } catch (Exception exp) { err = "" + exp; } }
public CommonModel GetGroupSelectList(int CompanyId) { CommonModel CommonModel = new CommonModel(); List <SelectList> GroupSelectList = new List <SelectList>(); var y = (from t in entity.tblTeams where t.COMPANYID == CompanyId || CompanyId == 0 select new { t.ID, t.TEAMNAME }).ToList(); GroupSelectList = y.Select(c => new SelectList { Id = c.ID, Text = c.TEAMNAME, } ).ToList(); CommonModel.GroupList = GroupSelectList; return(CommonModel); }
public ActionResult Common() { var model = new CommonModel { EnabledIcon = _settingService.GetSettingByKey <bool>(CommonSettingNames.EnabledIcon), MetaDescription = _settingService.GetSettingByKey <string>(CommonSettingNames.MetaDescription), MetaKeywords = _settingService.GetSettingByKey <string>(CommonSettingNames.MetaKeywords), MetaTitle = _settingService.GetSettingByKey <string>(CommonSettingNames.MetaTitle), StoreName = _settingService.GetSettingByKey <string>(CommonSettingNames.StoreName), StoreURL = _settingService.GetSettingByKey <string>(CommonSettingNames.StoreURL), EnabledReview = _settingService.GetSettingByKey <bool>(CommonSettingNames.EnabledReview), }; return(View(model)); }
public CommonModel GetUserSelectList(int CompanyId) { CommonModel CommonModel = new CommonModel(); List <SelectList> UserSelectList = new List <SelectList>(); var y = (from t in entity.tblUserMasters where t.COMPANYID == CompanyId || CompanyId == 0 select new { t.ID, t.FIRSTNAME, t.SURNAME }).ToList(); UserSelectList = y.Select(c => new SelectList { Id = c.ID, Text = c.FIRSTNAME + " " + c.SURNAME, } ).ToList(); CommonModel.UserList = UserSelectList; return(CommonModel); }
public string FromValueGetText(CommonModel comodel) { string OutTextStr = ""; StringBuilder strSql = new StringBuilder(); strSql.Append("select " + comodel.ReturnText + " from " + comodel.TableName + " where 1=1 " + comodel.WhereStr + ""); object obj = SqlHelper.ExecuteScalar(SqlHelper.ConnectionString, CommandType.Text, strSql.ToString()); if (obj != null) { OutTextStr = obj.ToString(); } return(OutTextStr); }
internal static CommonModel ApiAiToCommonModel(AIResponse aiResponse) { var commonModel = new CommonModel() { Id = aiResponse.Id }; commonModel.Session.Id = aiResponse.SessionId; commonModel.Request.Intent = aiResponse.Result.Metadata.IntentName; commonModel.Request.State = aiResponse.Result.ActionIncomplete ? "IN_PROGRESS" : "COMPLETED"; commonModel.Request.Channel = aiResponse.Result.Source; commonModel.Request.Parameters = aiResponse.Result.Parameters.ToList() .ConvertAll(a => new KeyValuePair <string, string>(a.Key, a.Value.ToString())); return(commonModel); }
public CommonModel GetCompanySelectList(int CompanyId) { CommonModel CommonModel = new CommonModel(); List <SelectList> CompanySelectList = new List <SelectList>(); var y = (from t in entity.tblOrganizations where t.ID == CompanyId || CompanyId == 0 select new { t.ID, t.TITLE }).ToList(); CompanySelectList = y.Select(c => new SelectList { Id = c.ID, Text = c.TITLE, } ).ToList(); CommonModel.CompanyList = CompanySelectList; return(CommonModel); }
public CommonModel GetCommonData() { var commonData = new CommonModel(); commonData.Genres = (List <GenreModel>)GetGenreData(); using (var context = new sparrow_dbEntities()) { commonData.Max = (double)context.SPRW_ARTIST.Max(i => i.POP_INDEX); commonData.Min = (double)context.SPRW_ARTIST.Min(i => i.POP_INDEX); commonData.StartDate = context.SPRW_ALBUM.Min(i => i.RELEASE_DATE); commonData.EndDate = context.SPRW_ALBUM.Max(i => i.RELEASE_DATE); } return(commonData); }
public ActionResult AddGst() { GstTaxModel gm = new GstTaxModel(); gm.CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); gm.StateList = new SelectList(Enumerable.Empty <SelectList>()); gm.GstcategoryList = new SelectList(dropdown.BindGst(null), "Value", "Text"); gm.DeviceCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); gm.DeviceSubCategoryList = new SelectList(Enumerable.Empty <SelectList>()); gm.ApplicableTaxTypeList = new SelectList(CommonModel.GetApplicationTax(), "Value", "Text"); gm.GstHSNCodeList = new SelectList(dropdown.BindGstHsnCode(), "Value", "Text"); gm.SACList = new SelectList(CommonModel.SAC_NumberList(), "Text", "Text"); gm.CTHNumberList = new SelectList(CommonModel.CTH_NumberList(), "Text", "Text"); return(View(gm)); }
public ActionResult Add() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; return View(); }
public ActionResult Edit() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); ContactViewModel viewModel = new ContactViewModel(); try { viewModel.ContactModel = dataService.GenerateContactModel(); viewModel.AddressModel = dataService.GenerateAddressModel(); viewModel.ContactNumbersModel1 = dataService.GenerateContactNumbersModelById(1); viewModel.ContactNumbersModel2 = dataService.GenerateContactNumbersModelById(2); viewModel.ContactNumbersModel3 = dataService.GenerateContactNumbersModelById(3); viewModel.ContactNumbersModel4 = dataService.GenerateContactNumbersModelById(4); viewModel.ContactNumbersModel5 = dataService.GenerateContactNumbersModelById(5); viewModel.EmailAddressModel = dataService.GenerateEmailAddressModelById(1); viewModel.ShoppingHoursModel = dataService.GenerateShoppingHoursModelById(1); viewModel.ContactAdditionalModel = dataService.GenerateContactAdditionalModelById(1); viewModel.SocialMediaModelFacebook = dataService.GenerateSocialMediaModelById(1); viewModel.SocialMediaModelTwitter = dataService.GenerateSocialMediaModelById(2); viewModel.SocialMediaModelYoutube = dataService.GenerateSocialMediaModelById(3); viewModel.SocialMediaModelInstagram = dataService.GenerateSocialMediaModelById(4); return View(viewModel); } catch (Exception ex) { throw ex; } finally { dataService = null; viewModel = null; } }
public ActionResult Add(ProductsListModel plm) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ProductsDataService dataService = new ProductsDataService(); try { if (ModelState.IsValid) { dataService.InsertProductList(plm); return RedirectToAction("Edit", "Products"); } else { return View(plm); } } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditCompanyAddress() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { string addressId = (string)Request.Form["addressId"]; string addressLine1 = (string)Request.Form["addressLine1"]; string addressLine2 = (string)Request.Form["addressLine2"]; string country = (string)Request.Form["country"]; string postCode = (string)Request.Form["postCode"]; return RedirectToAction("Edit", "Contact"); } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult Edit() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ServicesViewModel viewModel = new ServicesViewModel(); ServicesDataService dataservice = new ServicesDataService(); try { int[] row1 = new int[] { 1, 2, 3 }; int[] row2 = new int[] { 6, 4, 5 }; viewModel.ServicesModelRow1 = dataservice.GenerateServiceModelByServicesIds(row1); viewModel.ServicesModelRow2 = dataservice.GenerateServiceModelByServicesIds(row2); return View(viewModel); } catch (Exception ex) { throw ex; } finally { viewModel = null; dataservice = null; } }
public ActionResult EditShoppingHours() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { string description = (string)Request.Form["description"]; string id = (string)Request.Form["id"]; dataService.UpdateShoppingHours(int.Parse(id), description); return RedirectToAction("Edit", "Contact"); } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditProductsMainImage() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ProductsDataService auDS = new ProductsDataService(); try { WebImage photo = null; var newFileName = ""; var imagePath = ""; string id = (string)Request.Form["edit_ProductsMainId"]; photo = WebImage.GetImageFromRequest(); if (photo != null) { newFileName = Guid.NewGuid().ToString() + "_" + Path.GetFileName(photo.FileName); imagePath = @"Contents\Images\Products\" + newFileName; photo.Save(@"~\" + imagePath); auDS.UpdateProductsMainImage(int.Parse(id), imagePath); } return RedirectToAction("Edit", "Products"); } catch (Exception ex) { throw ex; } finally { auDS = null; } }
public ActionResult EditSocial(SocialMediaModel model) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { string id = (string)Request.Form["id"]; if (ModelState.IsValid) { dataService.UpdateSocialMedia(int.Parse(id), model.SocialMediaUrl); return RedirectToAction("Edit", "Contact"); } else { model = new SocialMediaModel(); model.SocialMediaId = int.Parse(id); model.SocialMediaUrl = model.SocialMediaUrl; return View(model); } } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult Index() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { string body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p> <br/><p>{3}</p><p>{4}</p>"; string name = (string)Request.Form["contact_name"]; string email = (string)Request.Form["contact_email"]; string company = (string)Request.Form["contact_company"]; string phone = (string)Request.Form["contact_phone"]; string subject = (string)Request.Form["contact_subject"]; string message = (string)Request.Form["contact_message"]; // Create the email object first, then add the properties. SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo(dataService.GenerateEmailAddressModelById(1).EmailAddress); myMessage.From = new MailAddress(email, name); myMessage.Subject = subject; myMessage.Html = string.Format(body, name, email, message, company, phone); // Create credentials, specifying your user name and password. var credentials = new NetworkCredential("*****@*****.**", "Passw0rd123##"); // Create an Web transport for sending email. var transportWeb = new Web(credentials); // Send the email, which returns an awaitable task. transportWeb.DeliverAsync(myMessage); return RedirectToAction("Sent"); } catch (System.Exception ex) { throw ex; } }
// GET: Products public ActionResult Index() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ProductsPageViewMainModel ppvMM = new ProductsPageViewMainModel(); ProductsDataService pDS = new ProductsDataService(); try { ppvMM.ProductsMainModel = pDS.GenerateProductsMainModel(); ppvMM.ProductsListModel = pDS.GenerateProductsListModel(); return View(ppvMM); } catch (Exception ex) { throw ex; } finally { ppvMM = null; pDS = null; } }
public ActionResult EditService(ServicesModel model) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ServicesDataService dataservice = new ServicesDataService(); string serviceId = (string)Request.Form["edit_ServicesId"]; string imageString = (string)Request.Form["edit_ImageString"]; string serviceName = (string)Request.Form["edit_ServiceName"]; try { if (ModelState.IsValid) { WebImage photo = null; var newFileName = ""; var imagePath = ""; photo = WebImage.GetImageFromRequest(); if (photo != null) { newFileName = Guid.NewGuid().ToString() + "_" + Path.GetFileName(photo.FileName); imagePath = @"Contents\Images\Services\" + newFileName; photo.Save(@"~\" + imagePath); model.ServicesId = int.Parse(serviceId); model.ImageString = imagePath; } else { model.ServicesId = int.Parse(serviceId); model.ImageString = imageString; } dataservice.UpdateService(model); return RedirectToAction("Edit", "Services"); } else { model.ServicesId = int.Parse(serviceId); model.ImageString = imageString; return View(model); } } catch (Exception ex) { throw ex; } finally { model = null; dataservice = null; } }
public ActionResult EditProductsMain(ProductsMainModel aum) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ProductsDataService auDS = new ProductsDataService(); string id = (string)Request.Form["edit_ProductsMainId"]; try { if (ModelState.IsValid) { aum.ProductsMainId = int.Parse(id); auDS.UpdateProductsMain(aum); return RedirectToAction("Edit", "Products"); } else { aum = new ProductsMainModel(); aum.ProductsMainId = int.Parse(id); return View(aum); } } catch (Exception ex) { throw ex; } finally { auDS = null; } }
public void GetPhotoThumbnail(string imageString) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; // Loading a default photo for realties that don't have a Photo new WebImage(HostingEnvironment.MapPath(@"~/" + imageString)).Write(); }
public ActionResult AddHeader(string tableHeader, int productCategoryId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; PriceDataService dataService = new PriceDataService(); ProductHeaderModel model = new ProductHeaderModel(); try { model.ProductCategoryId = productCategoryId; model.ProductTableTitleDescription = tableHeader; dataService.InsertProductHeader(model); return RedirectToAction("Edit", "Price"); } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditPrice(PriceListModel plm) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; PriceDataService dataService = new PriceDataService(); PriceListModel model = new PriceListModel(); try { if (ModelState.IsValid) { model.PriceListId = plm.PriceListId; model.ProductName = plm.ProductName; model.ProductDescription = plm.ProductDescription; model.Price = plm.Price; dataService.UpdatePriceList(model); return RedirectToAction("Edit", "Price"); } else { return View(plm); } } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditSocial(int socialMediaId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; try { ContactDataService dataService = new ContactDataService(); SocialMediaModel model = new SocialMediaModel(); model = dataService.GenerateSocialMediaModelById(socialMediaId); return View(model); } catch (Exception ex) { throw ex; } }
public ActionResult EditHeader(int headerId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; PriceDataService dataService = new PriceDataService(); ProductHeaderModel model = new ProductHeaderModel(); try { model = dataService.GetProductHeaderByHeaderId(headerId); return View(model); } catch (Exception ex) { throw ex; } finally { dataService = null; } }
public ActionResult EditContactAdditional(int contactAdditionalId) { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; ContactDataService dataService = new ContactDataService(); try { ContactAdditionalModel model = new ContactAdditionalModel(); model = dataService.GenerateContactAdditionalModelById(1); return View(model); //string id = (string)Request.Form["id"]; //if (ModelState.IsValid) //{ // dataService.UpdateContactAdditional(int.Parse(id), "", model.ContactAdditionalModel.ContactDescription); // return RedirectToAction("Edit", "Contact"); //} //else //{ // model = new ContactViewModel(); // model.ContactAdditionalModel = new Models.ContactAdditionalModel(); // model.ContactAdditionalModel.ContactAdditionalId = int.Parse(id); // model.ContactAdditionalModel.ContactDescription = model.ContactAdditionalModel.ContactDescription; // return View(model.ContactAdditionalModel); //} } catch (Exception ex) { throw ex; } finally { dataService = null; } }
// GET: Gallery public ActionResult Index() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; GalleryDataService dataService = new GalleryDataService(); GalleryViewModel viewModel = new GalleryViewModel(); try { viewModel.GalleryModelRow1 = dataService.GenerateGalleryByRow(1); viewModel.GalleryModelRow2 = dataService.GenerateGalleryByRow(2); viewModel.GalleryModelRow3 = dataService.GenerateGalleryByRow(3); viewModel.GalleryModelRow4 = dataService.GenerateGalleryByRow(4); viewModel.GalleryModelRow5 = dataService.GenerateGalleryByRow(5); viewModel.GalleryModelRow6 = dataService.GenerateGalleryByRow(6); viewModel.GalleryModelRow7 = dataService.GenerateGalleryByRow(7); viewModel.GalleryModelRow8 = dataService.GenerateGalleryByRow(8); viewModel.GalleryModelRow9 = dataService.GenerateGalleryByRow(9); viewModel.GalleryModelRow10 = dataService.GenerateGalleryByRow(10); viewModel.GalleryModelRow11 = dataService.GenerateGalleryByRow(11); viewModel.GalleryModelRow12 = dataService.GenerateGalleryByRow(12); viewModel.GalleryModelRow13 = dataService.GenerateGalleryByRow(13); viewModel.GalleryModelRow14 = dataService.GenerateGalleryByRow(14); viewModel.GalleryModelRow15 = dataService.GenerateGalleryByRow(15); viewModel.GalleryModelRow16 = dataService.GenerateGalleryByRow(16); viewModel.GalleryModelRow17 = dataService.GenerateGalleryByRow(17); viewModel.GalleryModelRow18 = dataService.GenerateGalleryByRow(18); viewModel.GalleryModelRow19 = dataService.GenerateGalleryByRow(19); viewModel.GalleryModelRow20 = dataService.GenerateGalleryByRow(20); viewModel.GalleryModelRow21 = dataService.GenerateGalleryByRow(21); viewModel.GalleryModelRow22 = dataService.GenerateGalleryByRow(22); viewModel.GalleryModelRow23 = dataService.GenerateGalleryByRow(23); viewModel.GalleryModelRow24 = dataService.GenerateGalleryByRow(24); viewModel.GalleryModelRow25 = dataService.GenerateGalleryByRow(25); viewModel.GalleryModelRow26 = dataService.GenerateGalleryByRow(26); viewModel.GalleryModelRow27 = dataService.GenerateGalleryByRow(27); viewModel.GalleryModelRow28 = dataService.GenerateGalleryByRow(28); viewModel.GalleryModelRow29 = dataService.GenerateGalleryByRow(29); viewModel.GalleryModelRow30 = dataService.GenerateGalleryByRow(30); return View(viewModel); } catch (Exception ex) { throw ex; } }