protected void uiButtonUpdate_Click(object sender, EventArgs e) { if (CurrentServices != null) { BLL.Services objData = CurrentServices; objData.EnName = uiTextBoxEnName.Text; objData.ArName = uiTextBoxArName.Text; objData.EnDescription = Server.HtmlEncode(uiFCKeditorEnDesc.Value); objData.ArDescription = Server.HtmlEncode(uiFCKeditorArDesc.Value); objData.Save(); } else { Companies objCompany = new Companies(); objCompany.GetCompanyByUserName(User.Identity.Name); BLL.Services objData = new BLL.Services(); objData.AddNew(); objData.CompanyID = objCompany.CompanyID; objData.EnName = uiTextBoxEnName.Text; objData.ArName = uiTextBoxArName.Text; objData.EnDescription = Server.HtmlEncode(uiFCKeditorEnDesc.Value); objData.ArDescription = Server.HtmlEncode(uiFCKeditorArDesc.Value); objData.TypeID = Convert.ToInt32(uiDropDownListAllServiceType.SelectedValue); objData.CreatedDate = DateTime.Now; objData.Save(); } uiPanelEdit.Visible = false; uiPanelViewServices.Visible = true; Clearfields(); CurrentServices = null; }
protected void uiButtonUpdate_Click(object sender, EventArgs e) { if (CurrentVedio != null) { BLL.Vedios objData = CurrentVedio; objData.ArTitle = uiTextBoxArName.Text; objData.EnTitle = uiTextBoxEnName.Text; objData.URL = uiTextBoxURL.Text; objData.Save(); } else { Companies objCompany = new Companies(); objCompany.GetCompanyByUserName(User.Identity.Name); BLL.Vedios objData = new BLL.Vedios(); objData.AddNew(); objData.ArTitle = uiTextBoxArName.Text; objData.EnTitle = uiTextBoxEnName.Text; objData.URL = uiTextBoxURL.Text; objData.CompanyID = objCompany.CompanyID; objData.CreatedDate = DateTime.Now; objData.Save(); } uiPanelEdit.Visible = false; uiPanelViewVideos.Visible = true; Clearfields(); CurrentVedio = null; BindData(); }
private void BindData() { Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); BLL.Photos objData = new BLL.Photos(); objData.GetPhotosByCompanyID(currentCompany.CompanyID); uiDataListPhotos.DataSource = objData.DefaultView; uiDataListPhotos.DataBind(); }
protected void uiLinkButtonAdd_Click(object sender, EventArgs e) { Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); if (uiFileUpload.HasFile) { DirectoryInfo Dir = new DirectoryInfo(Server.MapPath("~/FileUploads/Companies/" + currentCompany.CompanyID.ToString())); if (!Dir.Exists) Dir.Create(); uiFileUpload.SaveAs(Server.MapPath("~/FileUploads/Companies/" + currentCompany.CompanyID.ToString() + "/" + uiFileUpload.FileName)); currentCompany.SchedulePath = "/FileUploads/Companies/" + currentCompany.CompanyID.ToString() + "/" + uiFileUpload.FileName; currentCompany.Save(); uiLabelmsg.Visible = true; } }
protected void uiLinkButtonAdd_Click(object sender, EventArgs e) { Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); BLL.Photos objData = new BLL.Photos(); objData.AddNew(); objData.EnTitle = uiTextBoxEnName.Text; objData.ArTitle = uiTextBoxArName.Text; DirectoryInfo Dir = new DirectoryInfo(Server.MapPath("~/FileUploads/Companies/" + currentCompany.CompanyID.ToString())); if (!Dir.Exists) Dir.Create(); if (uiFileUploadPhoto.HasFile) { uiFileUploadPhoto.SaveAs(Server.MapPath("~/FileUploads/Companies/" + currentCompany.CompanyID.ToString() + "/" + uiFileUploadPhoto.FileName)); objData.PhotoPath = "/FileUploads/Companies/" + currentCompany.CompanyID.ToString() + "/" + uiFileUploadPhoto.FileName; } objData.CreatedDate = DateTime.Now; objData.CompanyID = currentCompany.CompanyID; objData.Save(); BindData(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bool servicesEnabled = false; Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); CompanyEnabledOptions options = new CompanyEnabledOptions(); options.GetCompanyEnabledOptionsByCompanyID(currentCompany.CompanyID); for (int i = 0; i < options.RowCount;i++ ) { if ((options.PackageOptionID == 11 || options.PackageOptionID == 12 || options.PackageOptionID == 13 || options.PackageOptionID == 14) && !servicesEnabled) { servicesEnabled = true; if(options.Enabled) uiLiteralMenu.Text += "<li class='VMenuBorder'></li><li><a class='hide' href='../Company/Services.aspx'>الخدمات</a></li>"; } if (options.PackageOptionID == 16) { if (options.Enabled) uiLiteralMenu.Text += " <li class='VMenuBorder'></li><li><a class='hide' href='../Company/Photos.aspx'>الصور</a></li>"; } if (options.PackageOptionID == 17) { if (options.Enabled) uiLiteralMenu.Text += " <li class='VMenuBorder'></li><li><a class='hide' href='../Company/Vidoes.aspx'>الفيديو</a></li>"; } if (options.PackageOptionID == 19) { if (options.Enabled) uiLiteralMenu.Text += " <li class='VMenuBorder'></li><li><a class='hide' href='../Company/Schedule.aspx'>الجدول الملاحى</a></li>"; } options.MoveNext(); } } }
private void LoadDDLs() { ServiceTypes types = new ServiceTypes(); types.LoadAll(); Companies objCompany = new Companies(); objCompany.GetCompanyByUserName(User.Identity.Name); CompanyEnabledOptions options = new CompanyEnabledOptions(); options.GetCompanyEnabledOptionsByCompanyID(objCompany.CompanyID); string filter =" ServiceTypeID in ( "; for (int i = 0; i < options.RowCount; i++) { if ((options.PackageOptionID == 11 || options.PackageOptionID == 12 || options.PackageOptionID == 13 || options.PackageOptionID == 14)) { if (options.Enabled && options.PackageOptionID == 11) filter += " 1 , "; else if (options.Enabled && options.PackageOptionID == 12) filter += " 6 , "; else if (options.Enabled && options.PackageOptionID == 13) filter += " 3 , "; else if (options.Enabled && options.PackageOptionID == 14) filter += " 7 , "; } options.MoveNext(); } filter = filter.Substring(0, filter.LastIndexOf(",") - 1); filter += ")"; types.Filter = filter; uiDropDownListAllServiceType.DataSource = types.DefaultView; uiDropDownListAllServiceType.DataTextField = "ArName"; uiDropDownListAllServiceType.DataValueField = "ServiceTypeID"; uiDropDownListAllServiceType.DataBind(); uiDropDownListAllServiceType.SelectedIndex = 0; }
private void BindData() { BLL.Services objData = new BLL.Services(); Companies objCompany = new Companies(); objCompany.GetCompanyByUserName(User.Identity.Name); objData.GetServicesByCompanyIDAndTypeID(objCompany.CompanyID, string.IsNullOrEmpty(uiDropDownListAllServiceType.SelectedValue) ? 0 : Convert.ToInt32(uiDropDownListAllServiceType.SelectedValue)); uiGridViewServices.DataSource = objData.DefaultView; uiGridViewServices.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); CompanyEnabledOptions options = new CompanyEnabledOptions(); options.GetCompanyEnabledOptionsByCompanyID(currentCompany.CompanyID); ResetAllFields(); for (int i = 0; i < options.RowCount; i++) { switch (options.PackageOptionID) { case 1: if (options.Enabled) { CompanyLogo.Attributes.Add("style", "display:block"); uiImageLogo.ImageUrl = currentCompany.LogoPath; } else { CompanyLogo.Attributes.Add("style", "display:none"); } break; case 7: if (options.Enabled) { CompanyWebsite.Attributes.Add("style", "display:block"); uiTextBoxWebSite.Text = currentCompany.WebSite; } else { CompanyWebsite.Attributes.Add("style", "display:none"); } break; case 8: if (options.Enabled) { CompanyBranches.Attributes.Add("style", "display:block"); uiFCKeditorEnBranches.Value = Server.HtmlDecode(currentCompany.EnBranches); uiFCKeditorArBranches.Value = Server.HtmlDecode(currentCompany.ArBranches); } else { CompanyBranches.Attributes.Add("style", "display:none"); } break; case 9: if (options.Enabled) { CompanyMap.Attributes.Add("style", "display:block"); uiTextBoxMapURL.Text = Server.HtmlDecode(currentCompany.MapPath); } else { CompanyMap.Attributes.Add("style", "display:none"); } break; case 10: if (options.Enabled) { CompanyAbout.Attributes.Add("style", "display:block"); uiFCKeditorEnAbout.Value = Server.HtmlDecode(currentCompany.EnAbout); uiFCKeditorArAbout.Value = Server.HtmlDecode(currentCompany.ArAbout); } else { CompanyAbout.Attributes.Add("style", "display:none"); } break; case 15: if (options.Enabled) { CompanyContacts.Attributes.Add("style", "display:block") ; uiFCKeditorEnContacts.Value = Server.HtmlDecode(currentCompany.EnContact); uiFCKeditorArContacts.Value = Server.HtmlDecode(currentCompany.ArContact); } else { CompanyContacts.Attributes.Add("style", "display:none"); } break; default: break; } options.MoveNext(); } uiTextBoxEnName.Text = currentCompany.EnName; uiTextBoxArName.Text = currentCompany.ArName; uiTextBoxEnAddress.Text = currentCompany.EnAddress; uiTextBoxArAddress.Text = currentCompany.ArAddress; uiTextBoxTele.Text = currentCompany.Tele; uiTextBoxFax.Text = currentCompany.Fax; uiTextBoxUserName.Text = currentCompany.UserName; } }
protected void uiButtonUpdate_Click(object sender, EventArgs e) { Companies currentCompany = new Companies(); currentCompany.GetCompanyByUserName(Page.User.Identity.Name); CompanyEnabledOptions options = new CompanyEnabledOptions(); options.GetCompanyEnabledOptionsByCompanyID(currentCompany.CompanyID); currentCompany.EnName = uiTextBoxEnName.Text ; currentCompany.ArName = uiTextBoxArName.Text ; currentCompany.EnAddress = uiTextBoxEnAddress.Text; currentCompany.ArAddress = uiTextBoxArAddress.Text; currentCompany.Tele = uiTextBoxTele.Text ; currentCompany.Fax = uiTextBoxFax.Text; for (int i = 0; i < options.RowCount; i++) { switch (options.PackageOptionID) { case 1: if (options.Enabled) { if (uiFileUploadLogoPath.HasFile) { uiFileUploadLogoPath.SaveAs(Server.MapPath("~/FileUploads/Companies" + "/" + uiFileUploadLogoPath.FileName)); currentCompany.LogoPath = "/FileUploads/Companies" + "/" + uiFileUploadLogoPath.FileName; } } break; case 7: if (options.Enabled) currentCompany.WebSite = uiTextBoxWebSite.Text; break; case 8: if (options.Enabled) { currentCompany.EnBranches = Server.HtmlEncode(uiFCKeditorEnBranches.Value); currentCompany.ArBranches = Server.HtmlEncode(uiFCKeditorArBranches.Value); } break; case 9: if (options.Enabled) currentCompany.MapPath = Server.HtmlEncode(uiTextBoxMapURL.Text); break; case 10: if (options.Enabled) { currentCompany.EnAbout = Server.HtmlEncode(uiFCKeditorEnAbout.Value); currentCompany.ArAbout = Server.HtmlEncode(uiFCKeditorArAbout.Value); } break; case 15: if (options.Enabled) { currentCompany.EnContact = Server.HtmlEncode(uiFCKeditorEnContacts.Value); currentCompany.ArContact = Server.HtmlEncode(uiFCKeditorArContacts.Value); } break; default: break; } options.MoveNext(); } currentCompany.Save(); }
private void BindData() { BLL.Vedios objData = new BLL.Vedios(); Companies objCompany = new Companies(); objCompany.GetCompanyByUserName(User.Identity.Name); objData.GetVedioByCompanyID(objCompany.CompanyID); uiGridViewVideos.DataSource = objData.DefaultView; uiGridViewVideos.DataBind(); }