Пример #1
0
        public void StartBidingOther(int id)
        {
#if DEBUG
            _log.Debug("id: {0}", id);
#endif
            _catId          = id;
            lbError.Visible = false;

            try
            {
                if (_catId <= 0)
                {
                    return;
                }

                var result = OtherDAL.GetAll(_catId);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;
                    return;
                }

                _dataSource = result.Data.Tables[0];
                grvSubOtherItems.DataSource   = result.Data;
                grvSubOtherItems.DataKeyNames = new string[] { "Id" };
                grvSubOtherItems.DataBind();
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }
Пример #2
0
        private void UpdateOtherProcess()
        {
            OtherBOL other = new OtherBOL()
            {
                Id             = string.IsNullOrEmpty(hfId.Value) ? 0 : int.Parse(hfId.Value),
                Name_VN        = tbxNameVN.Text,
                Name_EN        = tbxNameEN.Text,
                Description_VN = tbxDesVN.Text,
                Description_EN = tbxDesEN.Text,
                IsGroup        = true,
                InsertDate     = DateTime.Now,
                UpdatedDate    = DateTime.Now
            };

            var result = OtherDAL.InsertOrUpdate(other);

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;

                return;
            }

            StartClearData();

            Response.Redirect(Request.RawUrl, false);
        }
Пример #3
0
        void initComboBox()
        {
            PipeDAL   pipeDAL   = new PipeDAL();
            ProDAL    proDal    = new ProDAL();
            int       proid     = proDal.getNowPro();
            DataTable pipedata  = pipeDAL.getPipeBaisc(proid);
            DataTable oilsdata  = new OilsDAL().getOilosData();
            DataTable pumpdata  = new PumpDAL().getPumpData();
            DataTable soildata  = new SoilDAL().getSoilData();
            DataTable otherdata = new OtherDAL().getOtherData();

            for (int i = 0; i < pipedata.Rows.Count; i++)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = pipedata.Rows[i]["pipe_name"];
                item.Tag     = pipedata.Rows[i]["pipe_id"];
                if (i == 0)
                {
                    item.IsSelected = true;
                }
                pipe.Items.Add(item);
            }
            for (int i = 0; i < oilsdata.Rows.Count; i++)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = oilsdata.Rows[i]["oils_name"];
                item.Tag     = oilsdata.Rows[i]["oils_id"] + " ";
                if (i == 0)
                {
                    item.IsSelected = true;
                }
                oils.Items.Add(item);
            }
        }
Пример #4
0
    /// <summary>
    /// this method is used for activating the selected MarketingSource(s).
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnActivate_Click(object sender, ImageClickEventArgs e)
    {
        EMarketingSource[] marketingSource = GetSelectedSource();
        OtherDAL           otherDal        = new OtherDAL();

        if (marketingSource.Length > 0)
        {
            StringBuilder strMarketingSourceId = new StringBuilder(String.Empty);
            foreach (EMarketingSource oMarketingSource in marketingSource)
            {
                strMarketingSourceId.Append("," + oMarketingSource.MarketingSourceID.ToString());
            }
            strMarketingSourceId.Remove(0, 1);

            Int64 returnresult = otherDal.SaveMarketingSource(strMarketingSourceId.ToString(), Convert.ToInt32(EOperationMode.Activate));
            if (returnresult == 0)
            {
                returnresult = 9999994;
            }
            divErrorMsg.Visible       = true;
            divErrorMsg.InnerHtml     = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
            hfMarketingSourceID.Value = "";
            GetSource();
        }
    }
Пример #5
0
    /// <summary>
    /// this method is used for adding new and updating the information regarding the MarketingSource which is
    /// called on clicking save button.
    /// </summary>
    private void UpdateSource()
    {
        OtherDAL         otherDal     = new OtherDAL();
        EMarketingSource objMarketing = new EMarketingSource {
            Notes = txtNotes.Text, Label = txtName.Text
        };

        objMarketing.IsActive = true;

        Int64 returnresult;

        if (hfMarketingSourceID.Value.ToString().Equals(""))
        {
            returnresult = otherDal.SaveMarketingSource(objMarketing, Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }
        else
        {
            objMarketing.MarketingSourceID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdMarketingSource.Rows[Convert.ToInt32(hfMarketingSourceID.Value)].DataItemIndex]["MarketingSourceID"]);
            returnresult = otherDal.SaveMarketingSource(objMarketing, Convert.ToInt32(EOperationMode.Update));
            if (returnresult == 0)
            {
                returnresult = 9999991;
            }
        }
        divErrorMsg.Visible       = true;
        divErrorMsg.InnerHtml     = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
        hfMarketingSourceID.Value = "";
        GetSource();
    }
Пример #6
0
        private void Button_build(object sender, RoutedEventArgs e)
        {
            IsNumber Isnumber = new IsNumber();

            if (name.Text.Length != 0 && buildCost.Text.Length != 0 && recoveryN.Text.Length != 0 && operatingCost.Text.Length != 0 && oilCost.Text.Length != 0 && electricityCost.Text.Length != 0)
            {
                if (Isnumber.isNumber(buildCost.Text.Trim()) == false || Isnumber.isNumber(recoveryN.Text.Trim()) == false || Isnumber.isNumber(operatingCost.Text.Trim()) == false || Isnumber.isNumber(oilCost.Text.Trim()) == false || Isnumber.isNumber(electricityCost.Text.Trim()) == false)
                {
                    MessageBox.Show("输入格式有误");
                }
                else
                {
                    OtherDAL dal = new OtherDAL();
                    dal.delOtherData(id);
                    Other other = new Other(id, name.Text, buildCost.Text, recoveryN.Text, operatingCost.Text, oilCost.Text, electricityCost.Text);
                    dal.addOtherData(other);
                    MessageBox.Show("修改成功");
                    Close();
                    return;
                }
            }
            else
            {
                MessageBox.Show("请确保没有空白项");
            }
        }
Пример #7
0
    public Int64 SaveProspectCustomerData(string prospectCustomerId, string fieldName, string value)
    {
        OtherDAL otherDal = new OtherDAL();
        long     savedProspectCustomerId = otherDal.SaveProspectCustomerData(Convert.ToInt32(prospectCustomerId), fieldName, value);

        // If this is a new prospect customer, track this conversion.
        if (prospectCustomerId.Equals("0"))
        {
            long clickId = 0;

            HttpCookie clickIdCookie = Context.Request.Cookies["advertiserClick"];
            if (clickIdCookie != null)
            {
                long.TryParse(clickIdCookie.Value, out clickId);
            }

            // if there's a click ID, save which click caused the conversion to a prospective customer, and their prospect ID
            if (clickId > 0)
            {
                IClickConversionRepository ccr = new ClickConversionRepository();
                ccr.SaveProspectConversion(clickId, savedProspectCustomerId);
            }
        }

        return(savedProspectCustomerId);
    }
Пример #8
0
        private void StartDeleteItemsProcessing(string listId)
        {
            try
            {
                var result = OtherDAL.DeleteAll(listId);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;

                    return;
                }

                if (result.Data != null &&
                    result.Data.Tables.Count > 0 &&
                    result.Data.Tables[0].Rows.Count > 0)
                {
                    StartShowDeleteMessageErrors(result.Data.Tables[0]);
                }

                lbError.Visible = false;
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException("[ucMenuItems][StartDeleteItemsProcessing]", ex.ToString());
                //---
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }
Пример #9
0
        public void StartBindingItems(int otherTypeId, string title)
        {
            string tag = __tag + "[StartBindingItems]";

            LogHelpers.WriteStatus(tag, "OtherTypeId = " + otherTypeId.ToString(), "Start...");

            try
            {
                if (otherTypeId <= 0)
                {
                    return;
                }

                lbTitle.Text = title;

                var result = OtherDAL.GetAll(otherTypeId);
                if (result.Code < 0)
                {
                    LogHelpers.WriteError(tag, result.ErrorMessage);
                    return;
                }

                lvMainRightLinkItems.DataSource   = result.Data;
                lvMainRightLinkItems.DataKeyNames = new string[] { "Id", "Name_VN", "Name_EN" };
                lvMainRightLinkItems.DataBind();
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
Пример #10
0
        public void StartBindingGroupOther(int id)
        {
            //formSubMenu.Visible = false;
            if (id <= 0)
            {
                return;
            }

            var result = OtherDAL.GetAllGroup(id);

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;

                return;
            }

            lbError.Visible = false;

            try
            {
                ddlSubMenu.DataSource     = result.Data;
                ddlSubMenu.DataValueField = "Id";
                ddlSubMenu.DataTextField  = "Name_VN";
                //---
                ddlSubMenu.DataBind();
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }
Пример #11
0
    public List <ComboBoxPair> GetMarketingSourceByPrefixText(string prefixText)
    {
        var otherDal = new OtherDAL();

        return(otherDal.GetMarketingSource(string.Empty, 3).Where(eMarketingSource => eMarketingSource.Label.ToLower().Contains(prefixText.ToLower())).Select(marketingSource => new ComboBoxPair()
        {
            text = marketingSource.Label, value = marketingSource.MarketingSourceID.ToString()
        }).ToList());
    }
Пример #12
0
        public Oth_Add()
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            OtherDAL otherDAL = new OtherDAL();

            otherid      = otherDAL.getMaxOtherId() + 1;
            otherId.Text = otherid + " ";
        }
Пример #13
0
        private void StartLoadSubOtherInfo(int id)
        {
            string tag = __tag + "[StartLoadSubOtherInfo]";

            LogHelpers.WriteStatus(tag, "Start...");

            lbError.Visible = false;

            try
            {
                var result = OtherDAL.Get(id);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;

                    return;
                }

                OtherBOL other = new OtherBOL(result.Data.Tables[0].Rows[0]);
                tbxNameVN.Text = other.Name_VN;
                tbxNameEN.Text = other.Name_EN;
                tbxLink.Text   = other.Link;
                if (!string.IsNullOrEmpty(other.ImageLink))
                {
                    //imgImage.ImageUrl = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), other.ImageLink.Split('|')[0]);
                    //imgImage.Visible = true;
                    //---
                    groupImages.Visible = true;
                    StartLoadImages(other.ImageLink);
                }
                else
                {
                    //imgImage.Visible = false;
                    groupImages.Visible = false;
                }
                tbxDesVN.Text = other.Description_VN;
                tbxDesEN.Text = other.Description_EN;

                btnSubmit.Text    = "Update";
                btnCancel.Visible = true;
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());

                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
Пример #14
0
    protected void imgBtnDelivered_Click(object sender, ImageClickEventArgs e)
    {
        imgBtnReadyToShip.ImageUrl    = "~/App/Images/readytoship-tab-off.gif";
        imgBtnDelivered.ImageUrl      = "~/App/Images/Delivered-tab-on.gif";
        imgBtnUpcomingOrders.ImageUrl = "~/App/Images/Upcoming-tab-off.gif";

        var     otherDal = new OtherDAL();
        DataSet ds       = otherDal.GetOrderDetail("", "", "", 0, Convert.ToInt32(ddlOrderStatus.Items.FindByText("Delivered").Value), Convert.ToInt32(ddlDeliveryMode.Items.FindByText("Select Delivery Mode").Value), 1);

        BindOrderList(ds);
        dgManageOrder.Columns[7].Visible = true;
    }
Пример #15
0
    private void FillBlockedDays(DateTime startDate, DateTime endDate, string strOwner)
    {
        var otherDal       = new OtherDAL();
        var objBlockedDay  = new List <EBlockedDay>();
        var sessionContext = IoC.Resolve <ISessionContext>();

        if (sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.FranchisorAdmin))
        {
            objBlockedDay = GetBlockedDayForCalendar(0, startDate.ToString(), endDate.ToString(), "Franchisor");
        }
        else if (sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.FranchiseeAdmin))
        {
            objBlockedDay = GetBlockedDayForCalendar(sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId, startDate.ToString(), endDate.ToString(), "Franchisee");
        }

        if (objBlockedDay != null && objBlockedDay.Count > 0)
        {
            for (int count = 0; count < objBlockedDay.Count; count++)
            {
                string strBlockedReason = string.Empty;

                if ((objBlockedDay[count].IsGlobal == false) && (sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.FranchisorAdmin)))
                {
                    string ControlID = "\"BlockedDay" + objBlockedDay[count].BlockedDayID + strOwner + "\"";

                    string strFranchisee = string.Empty;
                    for (int i = 0; i < objBlockedDay[count].BlockDayFranchisee.Count; i++)
                    {
                        if (strFranchisee != string.Empty)
                        {
                            strFranchisee = strFranchisee + "<br>" + (i + 1) + ": " + objBlockedDay[count].BlockDayFranchisee[i].Franchisee.Name;
                        }
                        else
                        {
                            strFranchisee = (i + 1) + ": " + objBlockedDay[count].BlockDayFranchisee[i].Franchisee.Name;
                        }
                    }
                    strFranchisee = "\"" + strFranchisee + " \"";
                    string strBlockedDayDescription = strFranchisee + "," + ControlID;
                    strBlockedReason = "<a  onmouseout='hideTipBubble(\"BlockedDay\")'   onmouseover='ShowBlockedDayFranchisee(" + strBlockedDayDescription + ")'> <img src='../Images/block-square.gif' />  " + objBlockedDay[count].BlockedReason + "</a>";
                }

                else
                {
                    strBlockedReason = "<img src='../Images/block-square.gif' /> " + objBlockedDay[count].BlockedReason;
                }


                _tblAppointments.Rows.Add(new object[] { "BlockedDay" + objBlockedDay[count].BlockedDayID.ToString() + strOwner, "BlockedDay", strBlockedReason, objBlockedDay[count].BlockedDate, string.Empty });
            }
        }
    }
Пример #16
0
    public string[] GetAllZipCodesByStateID(string stateid)
    {
        OtherDAL otherDal = new OtherDAL();

        EZip[]        objZip = otherDal.GetSimilarZipCode(stateid, 1).ToArray();
        List <string> items  = new List <string>(objZip.Length);

        foreach (EZip objEZip in objZip)
        {
            items.Add(objEZip.ZipCode);
        }
        return(items.ToArray());
    }
Пример #17
0
    protected void imgBtnUpcomingOrders_Click(object sender, ImageClickEventArgs e)
    {
        imgBtnReadyToShip.ImageUrl    = "~/App/Images/readytoship-tab-off.gif";
        imgBtnDelivered.ImageUrl      = "~/App/Images/Delivered-tab-off.gif";
        imgBtnUpcomingOrders.ImageUrl = "~/App/Images/Upcoming-tab-on.gif";

        var     otherDal = new OtherDAL();
        DataSet ds       = otherDal.SearchOrderForUpcomingEvents();

        BindOrderList(ds);

        dgManageOrder.Columns[7].Visible = false;
    }
Пример #18
0
    public string[] GetSimilarZipCodeByDistance(string zipcode, string distance)
    {
        OtherDAL otherDal = new OtherDAL();

        EZip[]        objZip = otherDal.GetSimilarZipCodeByDistance(zipcode, distance, 2).ToArray();
        List <string> items  = new List <string>(objZip.Length);

        foreach (EZip objEZip in objZip)
        {
            items.Add(objEZip.ZipCode);
        }
        return(items.ToArray());
    }
Пример #19
0
        public void recoveryData(int id)
        {
            OtherDAL  dal  = new OtherDAL();
            DataTable data = dal.getSingleOtherData(id);

            otherId.Text         = data.Rows[0]["other_id"] + " ";
            name.Text            = data.Rows[0]["other_name"] + " ";
            buildCost.Text       = data.Rows[0]["cost_build"] + " ";
            recoveryN.Text       = data.Rows[0]["n_recovery"] + " ";
            operatingCost.Text   = data.Rows[0]["cost_operating"] + " ";
            oilCost.Text         = data.Rows[0]["cost_oil"] + " ";
            electricityCost.Text = data.Rows[0]["cost_electricity"] + " ";
        }
Пример #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Title = "Edit Customer";
     if (!IsPostBack)
     {
         if (Request.QueryString["CustomerID"] != null)
         {
             var   otherDal     = new OtherDAL();
             Int64 returnresult = otherDal.GetUid(Convert.ToInt32(Request.QueryString["CustomerID"]));
             UCEditCustomer1.UserID = Convert.ToInt32(returnresult);
         }
     }
 }
Пример #21
0
    /// <summary>
    /// this method fills the datagrid with relevant information
    /// about the MarketingSources.
    /// </summary>
    private void GetSource()
    {
        OtherDAL otherDal = new OtherDAL();

        EMarketingSource[] objMarketing = otherDal.GetMarketingSource(string.Empty, 0).ToArray();

        DataTable dtMarketingSource = new DataTable();

        dtMarketingSource.Columns.Add("MarketingSourceID");
        dtMarketingSource.Columns.Add("Source");
        dtMarketingSource.Columns.Add("notes");
        dtMarketingSource.Columns.Add("Active");

        if (objMarketing.Length > 0 && objMarketing.Length > 0)
        {
            for (int icount = 0; icount < objMarketing.Length; icount++)
            {
                if (objMarketing[icount].IsActive.ToString().Equals("True"))
                {
                    dtMarketingSource.Rows.Add(new object[] { objMarketing[icount].MarketingSourceID, objMarketing[icount].Label, objMarketing[icount].Notes, "Active" });
                }
                else
                {
                    dtMarketingSource.Rows.Add(new object[] { objMarketing[icount].MarketingSourceID, objMarketing[icount].Label, objMarketing[icount].Notes, "Deactivated" });
                }
            }

            grdMarketingSource.DataSource = dtMarketingSource;
            ViewState["DSGRID"]           = dtMarketingSource;

            grdMarketingSource.DataBind();

            txtName.Text               = "";
            txtNotes.Text              = "";
            hfMarketingSourceID.Value  = "";
            grdMarketingSource.Visible = true;
            btnActivate.Enabled        = true;
            btnDeActivate.Enabled      = true;
            btnDelete.Enabled          = true;
        }
        else
        {
            divErrorMsg.Visible   = true;
            divErrorMsg.InnerText = "No Records Found";
            //ClientScript.RegisterStartupScript(typeof(string), "jscode", "DisableAll();", true);
            btnActivate.Enabled        = false;
            btnDeActivate.Enabled      = false;
            btnDelete.Enabled          = false;
            grdMarketingSource.Visible = false;
        }
    }
Пример #22
0
 public void button_dele(object sender, RoutedEventArgs e)
 {
     if (table.SelectedIndex >= 0)
     {
         int      otherid = int.Parse(data.Rows[table.SelectedIndex]["other_id"] + " ");
         OtherDAL dal     = new OtherDAL();
         dal.delOtherData(otherid);
         initTable();
     }
     else
     {
         MessageBox.Show("没有选中项,无法删除");
     }
 }
Пример #23
0
    public bool CheckUserNameAvailability_nonSSL(string userName, string userId)
    {
        //var repository = IoC.Resolve<IUserRepository<Customer>>();
        //long checkUserId = 0;
        //long.TryParse(userId.Trim(), out checkUserId);
        //if (checkUserId == 0)
        //    return !repository.UserNameExists(userName);
        //else
        //    return !repository.UserNameExists(checkUserId, userName);

        var otherDal = new OtherDAL();

        return(otherDal.CheckUniqueUserName(userName, Convert.ToInt64(userId)));
    }
Пример #24
0
    protected void imgBtnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        var otherDal = new OtherDAL();
        EOrderShippingInformation objShippingInfo = new EOrderShippingInformation();

        EZip objzip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlstate.SelectedItem.Value);

        if (objzip.CityID == 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "JSCode_CityValidation", "alert('City Name entered is not correct.'); ", true);
            return;
        }
        else if (objzip.ZipID == 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "JSCode_ZipValidation", "alert('Zip Code entered is not correct.'); ", true);
            return;
        }
        objShippingInfo.OrderShippingInformationID = Convert.ToInt32(Request.QueryString["OrderShippingInformationID"].ToString());
        objShippingInfo.Carrier = Convert.ToInt32(ddlcarrier.SelectedValue);
        objShippingInfo.CarrierTransactionNumber = txtcarriertno.Text;
        objShippingInfo.ShippingDate             = Convert.ToDateTime(txtShippingDate.Text).ToString();
        objShippingInfo.ShippingNotes            = txtShippingNotes.Text;
        objShippingInfo.ShippingAddressID        = Convert.ToInt32(hfAddressID.Value);
        objShippingInfo.TrackingNumber           = txtTrackingNo.Text;

        objShippingInfo.ShippingAddress           = new EAddress();
        objShippingInfo.ShippingAddress.AddressID = Convert.ToInt32(hfAddressID.Value);
        objShippingInfo.ShippingAddress.Address1  = txtAddress1.Text;
        objShippingInfo.ShippingAddress.Address2  = txtAddress2.Text;
        objShippingInfo.ShippingAddress.StateID   = Convert.ToInt32(ddlstate.SelectedValue);
        objShippingInfo.ShippingAddress.CityID    = objzip.CityID;
        objShippingInfo.ShippingAddress.ZipID     = objzip.ZipID;


        objShippingInfo.LastModifiedBy     = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
        objShippingInfo.LastModifiedByRole = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleId);

        Int64 returnresult = otherDal.UpdateShippingInfo(objShippingInfo);

        if (returnresult > 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "jscode_savesuccessful", "parent.parent.GB_hide(); ", true);
        }
        else
        {
            ClientScript.RegisterStartupScript(typeof(string), "jscode_saveerror", "alert('Shipping Information not saved successfully.'); ", true);
        }
    }
Пример #25
0
        private void InsertOrUpdateBannerProcess()
        {
            string tag = __tag + "[InsertOrUpdateBannerProcess]";

            LogHelpers.WriteStatus(tag, "Start...");

            try
            {
                OtherBOL banner = new OtherBOL()
                {
                    Id             = _id > 0 ? _id : 0,
                    Name_VN        = tbxNameVN.Text,
                    Name_EN        = tbxNameEN.Text,
                    Description_VN = tbxDesVN.Text,
                    Description_EN = tbxDesEN.Text,
                    Link           = tbxLink.Text,
                    ImageLink      = UploadImageProcess(),
                    ParentId       = _catId,
                    OtherType      = _catId,
                    InsertDate     = DateTime.Now,
                    UpdatedDate    = DateTime.Now
                };

                var result = OtherDAL.InsertOrUpdate(banner);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;

                    return;
                }

                StartClearData();

                Response.Redirect(Request.RawUrl, false);
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());

                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
Пример #26
0
    private List <EBlockedDay> GetBlockedDayForCalendar(long intUserShellID, string strStartDate, string strEndDate, string strRoleType)
    {
        var otherDal = new OtherDAL();

        switch (strRoleType)
        {
        case "Franchisor":
            return(otherDal.GetBlockedDayForCalendar(intUserShellID, strStartDate, strEndDate, 1));

        case "Franchisee":
            return(otherDal.GetBlockedDayForCalendar(intUserShellID, strStartDate, strEndDate, 0));

        default:
            return(otherDal.GetBlockedDayForCalendar(intUserShellID, strStartDate, strEndDate, 0));
        }
    }
Пример #27
0
    protected void ibtnsave_Click(object sender, ImageClickEventArgs e)
    {
        var         otherDal    = new OtherDAL();
        EBlockedDay objBlockday = new EBlockedDay
        {
            BlockedDate   = hfBlockDate.Value,
            BlockedReason = txtBlockReason.Text,
            IsActive      = true
        };

        var sessionContext = IoC.Resolve <ISessionContext>();

        //TODO: call by javascript
        EBlockedDayFranchisee[] objBlockdayFranchisee = GetSelectedFranchisee();


        if ((sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.FranchisorAdmin)) && ((objBlockdayFranchisee.Length == grdFranchisee.Rows.Count) || (objBlockdayFranchisee.Length == 0)))
        {
            objBlockday.IsGlobal = true;
        }
        else if (sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.FranchiseeAdmin))
        {
            objBlockday.IsGlobal = false;
        }


        objBlockday.BlockDayFranchisee = objBlockdayFranchisee.ToList();

        Int64 returnresult = otherDal.SaveBlockedDay(objBlockday, Convert.ToInt32(EOperationMode.Insert));

        if (returnresult == 0)
        {
            returnresult = 9999990;
        }

        hfBlockDate.Value   = "";
        txtBlockDate.Text   = "";
        txtBlockReason.Text = "";
        //setView(ViewState["ViewType"].ToString());

        CheckBox chk = (CheckBox)grdFranchisee.HeaderRow.FindControl("chkboxheader");

        System.Text.StringBuilder strJsCloseWindow = new System.Text.StringBuilder();
        strJsCloseWindow.Append(" <script language = 'Javascript'> document.getElementById('" + chk.ClientID + "').checked=false;GridMasterCheck(); </script>");
        ClientScript.RegisterStartupScript(typeof(string), "JSCode", strJsCloseWindow.ToString());
    }
Пример #28
0
        public void StartBidingOtherType(int id)
        {
            string tag = __tag + "[StartBidingOtherType]";

            LogHelpers.WriteStatus(tag, "Start...");

            lbError.Visible = false;

            try
            {
                ResultBOL <DataSet> result = null;
                if (id <= 0)
                {
                    result = OtherTypeDAL.GetAll();
                }
                else
                {
                    result = OtherDAL.GetAll(id);
                }

                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;
                    return;
                }

                _dataSource = result.Data.Tables[0];
                grvOtherItems.DataSource   = result.Data;
                grvOtherItems.DataKeyNames = new string[] { "Id" };
                grvOtherItems.DataBind();
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
Пример #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Ucleftpanel1.Redirect = false;

        Ucmenucontrol2.RoleName = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleAlias;
        if (IsPostBack != true)
        {
            spcurdate.InnerText = DateTime.Now.ToString("dddd, dd MMMM, yyyy");

            var currentRole = (Roles)IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.GetSystemRoleId;
            Ucwelcomebox2.SetLinks(currentRole);
            OtherDAL otherDal         = new OtherDAL();
            string   strSystemVersion = otherDal.GetConfigurationValue("SystemVersion");

            HtmlAnchor anchor = (HtmlAnchor)Ucwelcomebox2.FindControl("lnkdashboard");

            SetLeftPanel(currentRole.ToString());
            SetRecentVisited(currentRole.ToString());
        }
    }
Пример #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "Edit Customer";
        Franchisee_Technician_TechnicianMaster objMaster = (Franchisee_Technician_TechnicianMaster)this.Master;

        objMaster.SetBreadcrumb = "<a href=\"/App/Franchisee/Technician/HomePage.aspx\">DashBoard></a>";
        objMaster.settitle("Customer Profile");
        if (!IsPostBack)
        {
            if (Request.QueryString["UserID"] != null)
            {
                UCEditCustomer1.UserID = Convert.ToInt32(Request.QueryString["UserID"].ToString());
            }
            else if (Request.QueryString["CustomerID"] != null)
            {
                OtherDAL otherDal = new OtherDAL();
                UCEditCustomer1.UserID = Convert.ToInt32(otherDal.GetUid(Convert.ToInt32(Request.QueryString["CustomerID"])));
            }
        }
    }