Esempio n. 1
0
        public void GetFirstMemu()
        {
            Chain.BLL.SysGroup bllGroup = new Chain.BLL.SysGroup();
            DataTable          dt       = bllGroup.GetGroupAuthority("GroupID=" + this.UserModel.UserGroupID + "  and ActionValue=1 and ModuleVisible=1 and ModuleParentID=0 order by ModuleOrder asc").Tables[0];

            this.rptFirstMenu.DataSource = dt;
            this.rptFirstMenu.DataBind();
        }
Esempio n. 2
0
 public void Set_GroupInfo()
 {
     if (this.HidAcction.Value == "Edit")
     {
         Chain.Model.SysGroup group = new Chain.BLL.SysGroup().GetModel(int.Parse(this.HidGid.Value));
         this.lblFrmTitle.Text     = this.lblFrmTitle.Text + "--" + group.GroupName + "  角色编辑";
         this.txtGroupID.Value     = group.GroupID.ToString();
         this.txtGroupName.Value   = group.GroupName;
         this.txtGroupRemark.Value = group.GroupRemark;
     }
 }
Esempio n. 3
0
    public static DataTable GetSysGroupByParentID(int groupID)
    {
        Chain.BLL.SysGroup bllSysGroup = new Chain.BLL.SysGroup();
        DataTable          dtSysGroup  = bllSysGroup.GetSysGroupByParentID(groupID);
        DataTable          result;

        if (dtSysGroup != null)
        {
            result = dtSysGroup;
        }
        else
        {
            result = null;
        }
        return(result);
    }
Esempio n. 4
0
 protected void rptFirstMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView dr      = (DataRowView)e.Item.DataItem;
         Repeater    rptItem = (Repeater)e.Item.FindControl("rptSecondMenu");
         if (rptItem != null)
         {
             Chain.BLL.SysGroup bllGroup = new Chain.BLL.SysGroup();
             DataTable          dt       = bllGroup.GetGroupAuthority(string.Concat(new object[]
             {
                 "GroupID=",
                 this.UserModel.UserGroupID,
                 " and  (ActionControl='module' OR ActionControl='page')  and ActionValue=1 and ModuleVisible=1 and ModuleParentID=",
                 dr["ModuleID"],
                 " order by ModuleOrder asc"
             })).Tables[0];
             rptItem.DataSource = dt;
             rptItem.DataBind();
         }
     }
 }
Esempio n. 5
0
 public void Set_Caption()
 {
     if (int.Parse(this.HidGid.Value) > 0)
     {
         Chain.Model.SysGroup group = new Chain.BLL.SysGroup().GetModel(int.Parse(this.HidGid.Value));
         this.txtGroupID.Value     = group.GroupID.ToString();
         this.txtGroupName.Value   = group.GroupName;
         this.txtGroupRemark.Value = group.GroupRemark;
         this.chkIsPublic.Checked  = group.IsPublic;
         this.chkIsPublic.Disabled = true;
     }
     if (base.Request.QueryString["ParentGroupID"] != null && base.Request.QueryString["ParentGroupID"] != "")
     {
         int parentGroupID          = int.Parse(base.Request.QueryString["ParentGroupID"]);
         Chain.Model.SysGroup group = new Chain.BLL.SysGroup().GetModel(parentGroupID);
         if (group != null && !group.IsPublic)
         {
             this.chkIsPublic.Checked  = false;
             this.chkIsPublic.Disabled = true;
             this.lblIsPublic.Visible  = false;
         }
     }
 }
Esempio n. 6
0
 protected void btnGroupSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.txtGroupName.Value != "" & this.txtGroupRemark.Value != "")
         {
             Chain.Model.SysGroup group = new Chain.Model.SysGroup();
             group.GroupID     = int.Parse(this.txtGroupID.Value);
             group.GroupName   = this.txtGroupName.Value;
             group.GroupRemark = this.txtGroupRemark.Value;
             Chain.BLL.SysGroup bllGroup = new Chain.BLL.SysGroup();
             bllGroup.Update(group);
             base.Response.Write("<Script Language='JavaScript'>if ( window.confirm('保存成功! 是否要进行系统角色管理?')) {  window.location.href='../SystemManage/GroupList.aspx?PID=32' } else {window.location.href= location.href };</script>");
         }
         else
         {
             base.Response.Write("<Script Language='JavaScript'>window.alert('数据不完整,请重新输入!');</script>");
         }
     }
     catch
     {
         base.Response.Write("<Script Language='JavaScript'>window.alert('系统错误 请与系统管理员联系!');</script>");
     }
 }
Esempio n. 7
0
        protected void btnSysParameter_Click(object sender, EventArgs e)
        {
            string pointnum = "";

            pointnum = pointnum + this.Txthycz.Text + "$";
            pointnum = pointnum + this.Txtjfbd.Text + "$";
            pointnum = pointnum + this.Txtjfdh.Text + "$";
            pointnum = pointnum + this.Txtsprk.Text + "$";
            pointnum = pointnum + this.Txtspxf.Text + "$";
            pointnum = pointnum + this.Txtjcxf.Text + "$";
            pointnum = pointnum + this.Txtksxf.Text + "$";
            pointnum = pointnum + this.Txthycc.Text + "$";
            pointnum = pointnum + this.Txthycs.Text + "$";
            pointnum = pointnum + this.Txtxfjl.Text + "$";
            pointnum = pointnum + this.Txthyczbb.Text + "$";
            pointnum = pointnum + this.Txtjfbdbb.Text + "$";
            pointnum = pointnum + this.Txtjfdhbb.Text + "$";
            pointnum = pointnum + this.Txtckrkmx.Text + "$";
            pointnum = pointnum + this.AccountsToMoney.Text + "$";
            Chain.BLL.SysParameter   bllUpdateParameter = new Chain.BLL.SysParameter();
            Chain.Model.SysParameter modelParameter     = bllUpdateParameter.GetModel(1);
            modelParameter.ParameterID      = 1;
            modelParameter.Pwd              = this.chkPwd.Checked;
            modelParameter.RegNullPwd       = this.ckbRegNullPwd.Checked;
            modelParameter.MoneyAndPoint    = this.chkMoneyAndPoint.Checked;
            modelParameter.AutoLevel        = this.chkAutoLevel.Checked;
            modelParameter.DegradeLevel     = this.chkDegradeLevel.Checked;
            modelParameter.GiveMemMoneyRate = decimal.Parse(this.txtGiveMemMoneyRate.Text);
            modelParameter.PastTime         = this.chkPastTime.Checked;
            string  strRecommendPoint   = this.txtRecommendPoint.Text.Trim();
            decimal dclDrawMoneyPercent = 0m;
            int     result = 0;

            if (!int.TryParse(this.txtStockCount.Text.Trim(), out result))
            {
                base.OutputWarn("库存报警数量只能输入正整数!");
            }
            else if (!int.TryParse(this.txtPointPeriod.Text.Trim(), out result))
            {
                base.OutputWarn("积分到期清零周期只能输入正整数!");
            }
            else if (!decimal.TryParse(this.txtDrawMoneyPercent.Text.Trim(), out dclDrawMoneyPercent))
            {
                base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!");
            }
            else
            {
                Regex regex = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");
                if (this.txtEmailAdress.Text != "" && !regex.IsMatch(this.txtEmailAdress.Text))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮箱格式不正确,请重新输入!");
                        return;
                    }
                    this.txtEmailAdress.Text = "";
                }
                if (this.txtEmailAdress.Text != "" && (this.txtEmailPwd.Text == "" || this.txtEmailSMTP.Text == "" || this.txtEnterpriseEmailPort.Text == ""))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮箱账号已经输入,请完善邮箱设置!");
                        return;
                    }
                }
                if (!int.TryParse(this.txtEnterpriseEmailPort.Text.Trim(), out result))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮件端口只能输入正整数!");
                        return;
                    }
                    this.txtEnterpriseEmailPort.Text = "25";
                }
                if (dclDrawMoneyPercent <= 0m || dclDrawMoneyPercent > 1m)
                {
                    base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!");
                }
                else if (!this.chkPayCard.Checked && (!this.chkPayCash.Checked & !this.chkPayBink.Checked & !this.chkPayCoupon.Checked))
                {
                    base.OutputWarn("*必须选择付费方式,否则无法结算!");
                }
                else
                {
                    modelParameter.DrawMoneyPercent      = dclDrawMoneyPercent;
                    modelParameter.RecommendPoint        = ((strRecommendPoint != "") ? int.Parse(strRecommendPoint) : 0);
                    modelParameter.PointPeriod           = Convert.ToInt32(this.txtPointPeriod.Text);
                    modelParameter.StockCount            = Convert.ToInt32(this.txtStockCount.Text);
                    modelParameter.ExpensePrefix         = this.txtExpensePrefix.Text;
                    modelParameter.GoodsExpensePrefix    = this.txtGoodsExpensePrefix.Text;
                    modelParameter.TimeExpensePrefix     = this.txtTimeExpensePrefix.Text;
                    modelParameter.MemCountPrefix        = this.txtMemCountPrefix.Text;
                    modelParameter.MemRechargePrefix     = this.txtMemRechargePrefix.Text;
                    modelParameter.GoodsInPrefix         = this.txtGoodsInPrefix.Text;
                    modelParameter.GoodsAllotPrefix      = this.txtGoodsAllotPrefix.Text;
                    modelParameter.MemDrawMoneyPrefix    = this.txtMemDrawMoneyPrefix.Text;
                    modelParameter.MemPointChangePrefix  = this.txtMemPointChangePrefix.Text;
                    modelParameter.GiftExchangePrefix    = this.txtGiftExchangePrefix.Text;
                    modelParameter.AllianceRebatePercent = decimal.Parse(this.txtAllianceRebatePercent.Text);
                    modelParameter.CardShopRebatePercent = decimal.Parse(this.txtCardShopRebatePercent.Text);
                    modelParameter.PointDrawPercent      = decimal.Parse(this.txtPointDrawPercent.Text);
                    modelParameter.Senseiccard           = this.chkSenseiccard.Checked;
                    modelParameter.Contacticcard         = this.chkContacticcard.Checked;
                    modelParameter.PointNumStr           = pointnum;
                    if (this.PrintPreview.Checked)
                    {
                        modelParameter.PrintPreview = 1;
                    }
                    else
                    {
                        modelParameter.PrintPreview = 0;
                    }
                    if (this.A4ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 0;
                    }
                    if (this.SanLianShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 1;
                    }
                    if (this.POs58ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 2;
                    }
                    if (this.POs80ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 3;
                    }
                    if (this.CKautoBackup.Checked)
                    {
                        modelParameter.AutoBackupDB = true;
                    }
                    else
                    {
                        modelParameter.AutoBackupDB = false;
                    }
                    modelParameter.AutoBackupDay                        = Convert.ToInt32(this.TBautoBackupDay.Text);
                    modelParameter.IsPayCard                            = this.chkPayCard.Checked;
                    modelParameter.IsPayCash                            = this.chkPayCash.Checked;
                    modelParameter.IsPayBink                            = this.chkPayBink.Checked;
                    modelParameter.IsPayCoupon                          = this.chkPayCoupon.Checked;
                    modelParameter.IsPayPoint                           = this.chkPayPoint.Checked;
                    modelParameter.AutoPrint                            = this.chkAutoPrint.Checked;
                    modelParameter.AccordPrint                          = this.chkAccordPrint.Checked;
                    modelParameter.PrintTitle                           = this.txtPrintTitle.Text;
                    modelParameter.PrintFootNote                        = this.txtPrintFootNote.Text;
                    modelParameter.IsStaff                              = this.chkStaff.Checked;
                    modelParameter.IsEmail                              = this.chkEmail.Checked;
                    modelParameter.IsEmailNotice                        = this.chkMoneyEmail.Checked;
                    modelParameter.EmailAdress                          = this.txtEmailAdress.Text;
                    modelParameter.EmailPwd                             = this.txtEmailPwd.Text;
                    modelParameter.EmailSMTP                            = this.txtEmailSMTP.Text;
                    modelParameter.EnterpriseEmailPort                  = int.Parse(this.txtEnterpriseEmailPort.Text);
                    modelParameter.EnterpriseEmailEnableSSL             = this.chkEnterpriseEmailEnableSSL.Checked;
                    modelParameter.EnterpriseEmailUseDefaultCredentials = this.chkEnterpriseEmailUseDefaultCredentials.Checked;
                    modelParameter.EnterpriseEmailDisplayName           = this.txtEnterpriseEmailDisplayName.Text;
                    modelParameter.IsMustSlotCard                       = this.chkIsMustSlotCard.Checked;
                    modelParameter.UnitList                             = ((this.txtUnitList.Text == "") ? "个" : this.txtUnitList.Text);
                    if (this.chkStaff.Checked)
                    {
                        modelParameter.StaffType = this.rdStaff.Checked;
                    }
                    modelParameter.PointLevel               = this.chkPointLevel.Checked;
                    modelParameter.SellerAccount            = this.txtSellerAccount.Text;
                    modelParameter.PartnerID                = this.txtPartnerID.Text;
                    modelParameter.PartnerKey               = this.txtPartnerKey.Text;
                    modelParameter.IsEditPwdNeedOldPwd      = this.chkIsNeedPwd.Checked;
                    modelParameter.IsMemRegisterStaff       = this.chkMemRegisterStaff.Checked;
                    modelParameter.StorageTimingPrefix      = this.txtStorageTimingPrefix.Text.Trim();
                    modelParameter.MemCountExpensePrefix    = this.txtMemCountExpensePrefix.Text.Trim();
                    modelParameter.IsAutoSendSMSByMemPast   = this.chkIsAutoSendSMSByMemPast.Checked;
                    this.txtAutoSendSMSByMemPastForDay.Text = ((this.txtAutoSendSMSByMemPastForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemPastForDay.Text);
                    if (modelParameter.IsAutoSendSMSByMemPast)
                    {
                        if (!int.TryParse(this.txtAutoSendSMSByMemPastForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) > 30)
                        {
                            base.OutputWarn("会员到期提醒提前天数只能是0到30之间的正整数!");
                            return;
                        }
                        modelParameter.AutoSendSMSByMemPastForDay = Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim());
                    }
                    else
                    {
                        modelParameter.AutoSendSMSByMemPastForDay = 0;
                    }
                    modelParameter.IsAutoSendSMSByMemBirthday   = this.chksAutoSendSMSByMemBirthday.Checked;
                    this.txtAutoSendSMSByMemBirthdayForDay.Text = ((this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemBirthdayForDay.Text);
                    if (modelParameter.IsAutoSendSMSByMemBirthday)
                    {
                        if (!int.TryParse(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) > 30)
                        {
                            base.OutputWarn("会员生日提醒提前天数只能是0到30之间的正整数!");
                            return;
                        }
                        modelParameter.AutoSendSMSByMemBirthdayForDay = Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim());
                    }
                    else
                    {
                        modelParameter.AutoSendSMSByMemBirthdayForDay = 0;
                    }
                    modelParameter.IsStartWeiXin        = this.chkIsStartWeiXin.Checked;
                    modelParameter.IsStartTimingProject = this.chkIsStartTimingProject.Checked;
                    modelParameter.IsStartMemCount      = this.chkIsStartMemCount.Checked;
                    modelParameter.EmailUserName        = this.txtEmailUserName.Text;
                    modelParameter.PointUsePercent      = decimal.Parse(this.txtPointUsePercent.Text);
                    modelParameter.PointDiscountPercent = decimal.Parse(this.txtPointDiscountPercent.Text);
                    modelParameter.IsSendCard           = this.chkIsSendCard.Checked;
                    modelParameter.ShopSmsManage        = this.chkShopSmsManage.Checked;
                    modelParameter.ShopPointManage      = this.chkShopPointManage.Checked;
                    modelParameter.ShopSettlement       = this.chkIsSettlement.Checked;
                    if (!PubFunction.curParameter.EnableGoods)
                    {
                        modelParameter.IsStartTimingProject = (modelParameter.IsStartMemCount = false);
                    }
                    if (!this.SwitchingMode(modelParameter))
                    {
                        base.OutputWarn("保存失败!");
                    }
                    else
                    {
                        List <Chain.Model.SysGroup> list = new Chain.BLL.SysGroup().GetModelList("");
                        foreach (Chain.Model.SysGroup item in list)
                        {
                            PubFunction.UpdateGroupAuthority(item.GroupID);
                        }
                        if (bllUpdateParameter.Update(modelParameter))
                        {
                            PubFunction pub = new PubFunction();
                            PubFunction.curParameter = pub.LoadSysParameter();
                            this.curParameter        = PubFunction.curParameter;
                            PubFunction.SaveSysLog(this._UserID, 3, "系统参数设置", "系统参数设置", this._UserShopID, DateTime.Now, PubFunction.ipAdress);
                            base.OutputWarn("保存成功!");
                        }
                        else
                        {
                            base.OutputWarn("系统异常,未保存数据,请再次点击保存!");
                        }
                    }
                }
            }
        }
Esempio n. 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         Chain.BLL.SysNotice bllNotice = new Chain.BLL.SysNotice();
         DataTable           dtNotice  = bllNotice.GetList(5, "", "SysNoticeTime desc").Tables[0];
         this.rptNotice.DataSource = dtNotice;
         this.rptNotice.DataBind();
         this.txtMemStartTime.Value = DateTime.Now.AddDays(-20.0).ToString("yyyy-MM-dd");
         this.txtMemEndTime.Value   = DateTime.Now.ToString("yyyy-MM-dd");
         int shopID = this.UserModel.UserShopID;
         this.sltShop.Value = shopID.ToString();
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this.UserModel.UserShopID);
         if (modelShop.ShopImageUrl != null && modelShop.ShopImageUrl.ToString() != "")
         {
             this.spShopPhoto.Src = modelShop.ShopImageUrl;
         }
         this.spShopName.InnerHtml       = modelShop.ShopName;
         this.spShopContactMan.InnerHtml = modelShop.ShopContactMan;
         this.spShopTel.InnerHtml        = modelShop.ShopTelephone;
         this.spShopAddress.InnerHtml    = this.BindAddress(this.UserModel.UserShopID);
         Chain.BLL.SysGroup   bllGroup   = new Chain.BLL.SysGroup();
         Chain.Model.SysGroup modelGroup = bllGroup.GetModel(this.UserModel.UserGroupID);
         this.spGroupName.InnerHtml = modelGroup.GroupName;
         Chain.BLL.Mem         bllMem         = new Chain.BLL.Mem();
         Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge();
         Chain.BLL.OrderLog    bllOrderLog    = new Chain.BLL.OrderLog();
         Chain.BLL.MemCount    bllMemCount    = new Chain.BLL.MemCount();
         string strMemToday               = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10),GETDATE(),120) AND MemID > 0";
         string strMemYesterday           = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120) AND MemID > 0";
         string strMoneyToday             = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
         string strMoneyYesterday         = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";
         string strGetMoneyToday          = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
         string strGetMoneyYesterday      = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";
         string strGetCountMoneyToday     = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
         string strGetCountMoneyYesterday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";
         if (modelShop.ShopID > 1)
         {
             strMemToday               += string.Format(" AND MemShopID = {0}", shopID);
             strMemYesterday           += string.Format(" AND MemShopID = {0}", shopID);
             strMoneyToday             += string.Format(" AND RechargeShopID = {0}", shopID);
             strMoneyYesterday         += string.Format(" AND RechargeShopID = {0}", shopID);
             strGetMoneyToday          += string.Format(" AND OrderShopID = {0}", shopID);
             strGetMoneyYesterday      += string.Format(" AND OrderShopID = {0}", shopID);
             strGetCountMoneyToday     += string.Format(" AND CountShopID = {0}", shopID);
             strGetCountMoneyYesterday += string.Format(" AND CountShopID = {0}", shopID);
         }
         this.spMemToday.InnerHtml     = bllMem.GetRecordCount(strMemToday).ToString();
         this.spMemYesterday.InnerHtml = bllMem.GetRecordCount(strMemYesterday).ToString();
         int     memtoday     = int.Parse(this.spMemToday.InnerHtml);
         int     memyesterday = int.Parse(this.spMemYesterday.InnerHtml);
         decimal rate;
         if (memtoday > memyesterday)
         {
             this.imgMemberRate.Src = "images/icon (18).png";
             if (memyesterday != 0)
             {
                 rate = memtoday - memyesterday / memyesterday;
             }
             else
             {
                 rate = 1m;
             }
         }
         else
         {
             if (memyesterday != 0)
             {
                 rate = memyesterday - memtoday / memyesterday;
             }
             else
             {
                 rate = 0m;
             }
             this.imgMemberRate.Src = "images/icon (1).png";
         }
         this.spMemberRate.InnerHtml     = (rate * 100m).ToString("F1") + "%";
         this.spMoneyToday.InnerHtml     = bllMemRecharge.GetRecMoney(strMoneyToday).ToString("F2");
         this.spMoneyYesterday.InnerHtml = bllMemRecharge.GetRecMoney(strMoneyYesterday).ToString("F2");
         decimal moneytoday     = decimal.Parse(this.spMoneyToday.InnerHtml);
         decimal moneyyesterday = decimal.Parse(this.spMoneyYesterday.InnerHtml);
         if (moneytoday > moneyyesterday)
         {
             this.imgMoneyRate.Src = "images/icon (18).png";
             if (moneyyesterday != 0m)
             {
                 rate = moneytoday - moneyyesterday / moneyyesterday;
             }
             else
             {
                 rate = 1m;
             }
         }
         else
         {
             if (moneyyesterday != 0m)
             {
                 rate = moneyyesterday - moneytoday / moneyyesterday;
             }
             else
             {
                 rate = 0m;
             }
             this.imgMoneyRate.Src = "images/icon (1).png";
         }
         this.spMoneyRate.InnerHtml         = (rate * 100m).ToString("F1") + "%";
         this.spGetMoneyToday.InnerHtml     = (bllOrderLog.GetTotalCash(strGetMoneyToday) + bllMemCount.GetTotalCash(strGetCountMoneyToday) + Convert.ToDecimal(this.spMoneyToday.InnerHtml)).ToString("F2");
         this.spGetMoneyYesterday.InnerHtml = (bllOrderLog.GetTotalCash(strGetMoneyYesterday) + bllMemCount.GetTotalCash(strGetCountMoneyYesterday) + Convert.ToDecimal(this.spMoneyYesterday.InnerHtml)).ToString("F2");
         decimal cashtoday     = decimal.Parse(this.spGetMoneyToday.InnerHtml);
         decimal cashyesterday = decimal.Parse(this.spGetMoneyYesterday.InnerHtml);
         if (moneytoday > cashyesterday)
         {
             this.imgCashRate.Src = "images/icon (18).png";
             if (cashyesterday != 0m)
             {
                 rate = cashtoday - cashyesterday / cashyesterday;
             }
             else
             {
                 rate = 1m;
             }
         }
         else
         {
             if (cashyesterday != 0m)
             {
                 rate = cashyesterday - cashtoday / cashyesterday;
             }
             else
             {
                 rate = 0m;
             }
             this.imgCashRate.Src = "images/icon (1).png";
         }
         this.spCashRate.InnerHtml = (rate * 100m).ToString("F1") + "%";
     }
 }
Esempio n. 9
0
        protected void btnAuthority_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtGroupName.Value.Trim() != "" & this.txtGroupRemark.Value.Trim() != "")
                {
                    Chain.Model.SysLog modelLog = new Chain.Model.SysLog();
                    modelLog.LogShopID       = this._UserShopID;
                    modelLog.LogUserID       = this._UserID;
                    modelLog.LogCreateTime   = DateTime.Now;
                    modelLog.LogActionID     = 11;
                    modelLog.LogType         = "系统角色";
                    this.group.GroupType     = Convert.ToInt32(this.txtGroupType.Value);
                    this.group.GroupName     = this.txtGroupName.Value.Trim();
                    this.group.ParentGroupID = int.Parse(this.sltParentGroup.Value);
                    this.group.IsPublic      = this.chkIsPublic.Checked;
                    if (this.group.ParentGroupID == 0)
                    {
                        this.group.ParentGroupID = 0;
                        this.group.ParentIDStr   = "";
                    }
                    else
                    {
                        Chain.Model.SysGroup parentGroup = this.bllGroup.GetModel(this.group.ParentGroupID);
                        if (parentGroup != null)
                        {
                            if (string.IsNullOrEmpty(parentGroup.ParentIDStr))
                            {
                                parentGroup.ParentIDStr = "/";
                            }
                            this.group.ParentIDStr = parentGroup.ParentIDStr + parentGroup.GroupID + "/";
                        }
                    }
                    this.group.GroupRemark = this.txtGroupRemark.Value.Trim();
                    if (int.Parse(this.HidGid.Value) > 0)
                    {
                        switch (PubFunction.curParameter.istry)
                        {
                        case 0:
                            if (int.Parse(this.txtGroupID.Value) != 1)
                            {
                                this.group.GroupID      = int.Parse(this.txtGroupID.Value);
                                this.group.CreateUserID = this._UserID;
                                modelLog.LogDetail      = "修改角色成功,角色名称:" + this.group.GroupName + ",说明:" + this.group.GroupRemark;
                                this.bllGroup.Update(this.group);
                                this.add = int.Parse(this.HidGid.Value);
                                new Chain.BLL.SysLog().Add(modelLog);
                            }
                            break;

                        case 1:
                            this.group.GroupID      = int.Parse(this.txtGroupID.Value);
                            this.group.CreateUserID = this._UserID;
                            modelLog.LogDetail      = "修改角色成功,角色名称:" + this.group.GroupName + ",说明:" + this.group.GroupRemark;
                            this.bllGroup.Update(this.group);
                            this.add = int.Parse(this.HidGid.Value);
                            new Chain.BLL.SysLog().Add(modelLog);
                            break;

                        case 2:
                            if (int.Parse(this.txtGroupID.Value) != 1)
                            {
                                this.group.GroupID      = int.Parse(this.txtGroupID.Value);
                                this.group.CreateUserID = this._UserID;
                                modelLog.LogDetail      = "修改角色成功,角色名称:" + this.group.GroupName + ",说明:" + this.group.GroupRemark;
                                this.bllGroup.Update(this.group);
                                this.add = int.Parse(this.HidGid.Value);
                                new Chain.BLL.SysLog().Add(modelLog);
                            }
                            break;
                        }
                    }
                    else if (this.txtGroupID.Value == "")
                    {
                        this.group.CreateUserID = this._UserID;
                        modelLog.LogDetail      = "新增角色成功,角色名称:" + this.group.GroupName + ",说明:" + this.group.GroupRemark;
                        this.add = this.bllGroup.Add(this.group);
                        new Chain.BLL.SysLog().Add(modelLog);
                    }
                    switch (PubFunction.curParameter.istry)
                    {
                    case 0:
                        if (this.txtGroupID.Value == "1")
                        {
                            base.OutputWarn("此版本为试用版,不可更改超级管理员。");
                        }
                        else if (this.SetGroupAuthority(this.add))
                        {
                            base.OutputWarn("保存成功!");
                        }
                        break;

                    case 1:
                        if (this.SetGroupAuthority(this.add))
                        {
                            base.OutputWarn("保存成功!");
                        }
                        break;

                    case 2:
                        if (this.txtGroupID.Value == "1")
                        {
                            base.OutputWarn("此版本为试用版,不可更改超级管理员。");
                        }
                        else if (this.SetGroupAuthority(this.add))
                        {
                            base.OutputWarn("保存成功!");
                        }
                        break;
                    }
                    List <Chain.Model.SysGroup> list = new Chain.BLL.SysGroup().GetModelList("");
                    foreach (Chain.Model.SysGroup item in list)
                    {
                        PubFunction.UpdateGroupAuthority(item.GroupID);
                    }
                }
                else
                {
                    base.OutputWarn("数据不完整,请重新输入!");
                }
            }
            catch
            {
                base.OutputWarn("系统错误,请与系统管理员联系!");
            }
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.shopID                = this._UserShopID;
            this.UserGroupID           = this._UserGroupID;
            this.userid                = this._UserID;
            this.txtMemStartTime.Value = DateTime.Now.AddDays(-20.0).ToString("yyyy-MM-dd");
            this.txtMemEndTime.Value   = DateTime.Now.ToString("yyyy-MM-dd");
            this.strOrder              = " SysNoticeTime desc";
            this.sltShop.Value         = this.shopID.ToString();
            Chain.BLL.SysNotice bllNotice = new Chain.BLL.SysNotice();
            DataTable           dtNotice  = bllNotice.GetList(5, this.strSql, this.strOrder).Tables[0];

            this.rpNotice.DataSource = dtNotice;
            this.rpNotice.DataBind();
            Chain.BLL.Mem       bllMem    = new Chain.BLL.Mem();
            Chain.BLL.OrderLog  bllLog    = new Chain.BLL.OrderLog();
            Chain.BLL.SysShop   bllShop   = new Chain.BLL.SysShop();
            Chain.Model.SysShop modelShop = bllShop.GetModel(this.shopID);
            this.lblShopName.Text    = modelShop.ShopName;
            this.lblShopAddress.Text = modelShop.ShopAddress;
            this.lblShopMem.Text     = modelShop.ShopContactMan;
            this.lblShopPhone.Text   = modelShop.ShopTelephone;
            if (this.shopID != 1 && PubFunction.curParameter.bolShopPointManage)
            {
                this.lblPointCount.Text = modelShop.PointCount.ToString();
            }
            else
            {
                this.lblPoint.Visible = false;
            }
            if (this.shopID != 1 && PubFunction.curParameter.bolShopSmsManage)
            {
                this.lblSmsCount.Text = modelShop.SmsCount.ToString();
            }
            else
            {
                this.lblSms.Visible = false;
            }
            Chain.Model.SysGroup modelSysGroup = new Chain.BLL.SysGroup().GetModel(this.UserGroupID);
            this.lbGroupName.Text = modelSysGroup.GroupName;
            Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge();
            Chain.BLL.OrderLog    bllOrderLog    = new Chain.BLL.OrderLog();
            Chain.BLL.MemCount    bllMemCount    = new Chain.BLL.MemCount();
            string strMemToday               = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10),GETDATE(),120) AND MemID > 0";
            string strMemYesterday           = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120) AND MemID > 0";
            string strMoneyToday             = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
            string strMoneyYesterday         = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";
            string strGetMoneyToday          = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
            string strGetMoneyYesterday      = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";
            string strGetCountMoneyToday     = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
            string strGetCountMoneyYesterday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)";

            if (modelShop.ShopID > 1)
            {
                strMemToday               += string.Format(" AND MemShopID = {0}", this.shopID);
                strMemYesterday           += string.Format(" AND MemShopID = {0}", this.shopID);
                strMoneyToday             += string.Format(" AND RechargeShopID = {0}", this.shopID);
                strMoneyYesterday         += string.Format(" AND RechargeShopID = {0}", this.shopID);
                strGetMoneyToday          += string.Format(" AND OrderShopID = {0}", this.shopID);
                strGetMoneyYesterday      += string.Format(" AND OrderShopID = {0}", this.shopID);
                strGetCountMoneyToday     += string.Format(" AND CountShopID = {0}", this.shopID);
                strGetCountMoneyYesterday += string.Format(" AND CountShopID = {0}", this.shopID);
            }
            this.ltlMemToday.Text          = bllMem.GetRecordCount(strMemToday).ToString();
            this.ltlMemYesterday.Text      = bllMem.GetRecordCount(strMemYesterday).ToString();
            this.lblrMoneyToday.Text       = bllMemRecharge.GetRecMoney(strMoneyToday).ToString("F2");
            this.lblrMoneyYesterday.Text   = bllMemRecharge.GetRecMoney(strMoneyYesterday).ToString("F2");
            this.lblGetMoneyToday.Text     = (bllOrderLog.GetTotalCash(strGetMoneyToday) + bllMemCount.GetTotalCash(strGetCountMoneyToday) + Convert.ToDecimal(this.lblrMoneyToday.Text)).ToString("F2");
            this.lblGetMoneyYesterday.Text = (bllOrderLog.GetTotalCash(strGetMoneyYesterday) + bllMemCount.GetTotalCash(strGetCountMoneyYesterday) + Convert.ToDecimal(this.lblrMoneyYesterday.Text)).ToString("F2");
            this.GetSysRemind();
        }