protected void IsNotice_CheckedChanged(object sender, EventArgs e)
        {
            var ccb = sender as ConfirmCheckBox;

            if (ccb != null)
            {
                var item = ccb.Parent.Parent as GridDataItem;
                if (item != null)
                {
                    var noteId = new Guid(item.GetDataKeyValue("NoticeID").ToString());
                    var isNote = ccb.Checked;
                    try
                    {
                        var result = _shopActivityNotice.UpdateIsNotice(isNote, noteId);
                        if (result)
                        {
                            NoteGrid.Rebind();
                        }
                    }
                    catch
                    {
                        RAM.Alert("设置公告失败!");
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void RgExchangedApplyListNeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (!IsPostBack)
            {
                RgExchangedApplyList.DataSource = new List <ShopExchangedApplyInfo>();
            }
            else
            {
                Guid shopId = string.IsNullOrEmpty(RcbShopList.SelectedValue)
                              ? Guid.Empty
                              : new Guid(RcbShopList.SelectedValue);
                if (shopId == Guid.Empty)
                {
                    RAM.Alert("请选择具体店铺!");
                    return;
                }
                var goodsIds = new List <Guid>();
                if (!string.IsNullOrEmpty(RtbSearchKey.Text))
                {
                    var dics = _goodsCenterSao.GetGoodsSelectList(RtbSearchKey.Text);
                    if (dics != null && dics.Count > 0)
                    {
                        goodsIds.AddRange(dics.Select(act => new Guid(act.Key)));
                    }
                }
                DateTime startTime = RdpStartTime.SelectedDate ?? DateTime.MinValue;
                DateTime endTime   = RdpEndTime.SelectedDate ?? DateTime.Now;

                int state = string.IsNullOrEmpty(RcbApplyState.SelectedValue)
                                  ? -1
                                  : Convert.ToInt32(RcbApplyState.SelectedValue);
                RgExchangedApplyList.DataSource = ShopExchangedApplyBll.ReadInstance.GetShopExchangedApplyList(false, RtbApplyNo.Text, startTime, endTime, goodsIds, shopId, state, RtbSearchKey.Text);
            }
        }
Example #3
0
 /// <summary>赠品GoodsGiftList选择事件
 /// </summary>
 protected void GoodsGiftListOnSelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (_isSearchGoods)
         {
             var giftGoodsId = new Guid(GoodsGiftList.SelectedValue);
             if (giftGoodsId != Guid.Empty)
             {
                 var result = _goodsCenterSao.GetGoodsListByGiftID(giftGoodsId);
                 if (result != null && result.Count > 0)
                 {
                     ConfirmGoodsList.Items.Clear();
                     foreach (var item in result)
                     {
                         ConfirmGoodsList.Items.Add(new RadListBoxItem(item.Value, item.Key.ToString()));
                     }
                 }
             }
         }
     }
     catch (Exception)
     {
         RAM.Alert("温馨提示:操作失败!");
     }
 }
Example #4
0
        protected void OnClick_Search(object sender, EventArgs e)
        {
            if (AuthWarehouses.Count == 0)
            {
                RAM.Alert("没有授权的仓库,无法查询!");
                return;
            }
            SelectWarehouse = new Guid(RCB_Warehouse.SelectedValue);
            StartTime       = RDP_StartTime.SelectedDate == null?DateTime.Now.AddMonths(-1) : Convert.ToDateTime(RDP_StartTime.SelectedDate);

            EndTime                    = RDP_EndTime.SelectedDate == null ? DateTime.Now : Convert.ToDateTime(RDP_EndTime.SelectedDate);
            CancelPersonel             = TB_CancelPersonel.Text.Trim();
            IsOrderComplete            = CB_IsOrderComplete.Checked;
            IsNeedManual               = CB_IsNeedManual.Checked;
            OrderNo                    = TB_OrderNo.Text.Trim();
            InvoiceName                = TB_InvoiceName.Text.Trim();
            InvoiceNo                  = TB_InvoiceNo.Text.Trim();
            Address                    = TB_Address.Text.Trim();
            InvoiceContent             = TB_InvoiceContent.Text.Trim();
            CurrentInvoiceState        = (InvoiceState)Convert.ToInt32(rcbInvoiceState.SelectedValue);
            CurrentInvoiceType         = Convert.ToInt32(rcbInvoiceType.SelectedValue);
            SelectSaleFilialeId        = RCB_SaleFiliale.SelectedValue;
            RGInvoice.CurrentPageIndex = 0;
            if (rcbInvoiceState.SelectedValue != "-1" && rcbInvoiceState.SelectedValue != "4" && CancelPersonel != "")
            {
                RAM.Alert("非作废发票不存在作废申请人!");
                return;
            }
            IsAfterSearch = true;
            RGInvoice.Rebind();
        }
        protected void LbxlsClick(object sender, EventArgs e)
        {
            IList <DebitNoteInfo> pList = new List <DebitNoteInfo>();

            foreach (GridDataItem dataItem in RG_DebitNote.Items)
            {
                var cbCheck = (CheckBox)dataItem.FindControl("CB_Check");
                if (cbCheck.Checked)
                {
                    var           purchasingId = new Guid(dataItem.GetDataKeyValue("PurchasingId").ToString());
                    DebitNoteInfo priceInfo    = _debitNoteDao.GetDebitNoteInfo(purchasingId);

                    if (priceInfo != null)
                    {
                        pList.Add(priceInfo);
                    }
                }
            }
            if (pList.Count == 0)
            {
                RAM.Alert("请选择要导出的借记单!");
            }
            else
            {
                OutPutExcel(pList);
            }
        }
Example #6
0
        protected void RGGoodsOrder_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            var pageIndex  = RGGoodsOrder.CurrentPageIndex + 1;
            var pageSize   = RGGoodsOrder.PageSize;
            int totalCount = 0;
            IList <GoodsOrderInfo> goodsOrderList = new List <GoodsOrderInfo>();
            var authWarehouseList = WMSSao.GetWarehouseAuthDic(CurrentSession.Personnel.Get().PersonnelId);

            if (authWarehouseList != null && authWarehouseList.WarehouseDics != null && authWarehouseList.WarehouseDics.Count > 0)
            {
                var authWarehouseIds = authWarehouseList.WarehouseDics.Select(act => act.Key).ToList();
                goodsOrderList = _goodsOrder.GetOrderList(authWarehouseIds, StartTime, EndTime, SearchGoods, SearchKey, new List <OrderState> {
                    OrderState.RequirePurchase
                }, pageIndex, pageSize, out totalCount);
            }
            else
            {
                RAM.Alert("当前登录人没有授权仓库!");
            }
            TextBoxDate.Text = CountRepeat(goodsOrderList);
            var expression = new GridSortExpression {
                FieldName = "OrderTime", SortOrder = GridSortOrder.Ascending
            };

            RGGoodsOrder.MasterTableView.SortExpressions.AddSortExpression(expression);
            RGGoodsOrder.DataSource       = goodsOrderList;
            RGGoodsOrder.VirtualItemCount = totalCount;
            if (goodsOrderList.Count > 0)
            {
                DicOrderClew = _operationLogManager.GetOperationLogList(goodsOrderList.Select(act => act.OrderId).ToList());
            }
        }
Example #7
0
        protected void TempRadGrid_InsertCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = e.Item as GridEditableItem;

            if (editedItem != null)
            {
                string templateName   = ((TextBox)editedItem.FindControl("TB_TemplateName")).Text;
                string shipper        = ((TextBox)editedItem.FindControl("TB_Shipper")).Text;
                string contactPerson  = ((TextBox)editedItem.FindControl("TB_ContactPerson")).Text;
                string contactAddress = ((TextBox)editedItem.FindControl("TB_ContactAddress")).Text;
                string remarks        = ((TextBox)editedItem.FindControl("TB_Remarks")).Text;
                string customer       = ((TextBox)editedItem.FindControl("TB_Customer")).Text;
                var    tempInfo       = new ExcelTemplateInfo
                {
                    TemplateName   = templateName,
                    Shipper        = shipper,
                    ContactPerson  = contactPerson,
                    ContactAddress = contactAddress,
                    Customer       = customer,
                    Remarks        = remarks
                };
                try
                {
                    _temp.Insert(tempInfo);
                }
                catch (Exception ex)
                {
                    RAM.Alert("添加失败 可能已经含有相同的模板名!" + ex.Message);
                }
            }
        }
Example #8
0
        protected void RgTempUpdateCommand(object sender, GridCommandEventArgs e)
        {
            var edit = e.Item as GridEditableItem;

            if (edit != null)
            {
                var    tempId          = new Guid(edit.GetDataKeyValue("TemplateID").ToString());
                string templateCaption = ((TextBox)edit.FindControl("TBTemplateCaption")).Text;
                string templateContent = ((TextBox)edit.FindControl("TBTemplateContent")).Text;
                int    templateType    = Convert.ToInt32(((RadComboBox)edit.FindControl("RCBTemplateType")).SelectedValue);
                var    info            = new TemplateInfo
                {
                    TemplateID      = tempId,
                    TemplateCaption = templateCaption,
                    TemplateContent = templateContent,
                    TemplateType    = templateType
                };
                try
                {
                    _templateManage.Update(info);
                }
                catch (Exception ex)
                {
                    RAM.Alert("修改失败!" + ex.Message);
                }
            }
        }
Example #9
0
        protected void RgTempInsertCommand(object sender, GridCommandEventArgs e)
        {
            var editItem = e.Item as GridEditableItem;

            if (editItem != null)
            {
                string templateCaption = ((TextBox)editItem.FindControl("TBTemplateCaption")).Text;
                string templateContent = ((TextBox)editItem.FindControl("TBTemplateContent")).Text;
                int    templateType    = Convert.ToInt32(((RadComboBox)editItem.FindControl("RCBTemplateType")).SelectedValue);
                var    info            = new TemplateInfo
                {
                    TemplateCaption = templateCaption,
                    TemplateContent = templateContent,
                    TemplateType    = templateType,
                    TemplateState   = 1
                };
                try
                {
                    _templateManage.Insert(info);
                }
                catch (Exception ex)
                {
                    RAM.Alert("添加失败,可能已存在相同的模板名!" + ex.Message);
                }
            }
        }
        // 删除
        protected void GridGoodsSeries_OnDeleteCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = (GridEditableItem)e.Item;
            var id         = (Guid)editedItem.GetDataKeyValue("SeriesID");

            try
            {
                string errorMessage;
                var    result = _goodsCenterSao.DeleteSeries(id, out errorMessage);//删除分类
                if (result)
                {
                    //记录工作日志
                    var personnelInfo = CurrentSession.Personnel.Get();
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, id, "",
                                               OperationPoint.GoodsSeriesManager.Delete.GetBusinessInfo(), string.Empty);
                }
                else
                {
                    RAM.Alert("操作无效!" + errorMessage);
                }
            }
            catch
            {
                RAM.Alert("删除失败!");
            }
        }
 /// <summary>
 /// 数据绑定
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 protected void RgExchangedApplyListNeedDataSource(object source, GridNeedDataSourceEventArgs e)
 {
     if (!IsPostBack)
     {
         RgRechargeList.DataSource = new List <RechargeDTO>();
     }
     else
     {
         //int pageSize = RgRechargeList.PageSize;
         //int pageIndex = RgRechargeList.CurrentPageIndex + 1;
         var rechargeState = Convert.ToInt32(RcbRechargeState.SelectedValue);
         var now           = DateTime.Now;
         var sTime         = RdpStartTime.SelectedDate ?? new DateTime(now.Year, now.Month, now.Day).AddDays(-30);
         var eTime         = RdpEndTime.SelectedDate == null ? DateTime.Now : Convert.ToDateTime(RdpEndTime.SelectedDate).AddDays(1).AddSeconds(-1);
         var result        = ShopSao.SelectRechargeListByParentId(ParentID, ShopId, rechargeState, JoinType, sTime, eTime, null, null);
         if (result == null)
         {
             RAM.Alert("服务连接失败");
             return;
         }
         if (result.IsSuccess)
         {
             RgRechargeList.DataSource       = result.Data;
             RgRechargeList.VirtualItemCount = result.Total;
         }
         else
         {
             RAM.Alert(result.Message);
         }
     }
 }
        // 修改
        protected void GridGoodsSeries_OnUpdateCommand(object sender, GridCommandEventArgs e)
        {
            var    editedItem  = (GridEditableItem)e.Item;
            var    id          = (Guid)editedItem.GetDataKeyValue("SeriesID");
            string seriesName  = ((TextBox)editedItem.FindControl("TB_SeriesName")).Text;
            var    goodsSeries = new GoodsSeriesInfo();

            goodsSeries.SeriesID   = id;
            goodsSeries.SeriesName = seriesName;

            string errorMessage;
            var    result = _goodsCenterSao.UpdateSeries(goodsSeries, out errorMessage);//更新系列

            if (result)
            {
                //记录工作日志
                var personnelInfo = CurrentSession.Personnel.Get();
                WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, id, "",
                                           OperationPoint.GoodsSeriesManager.Edit.GetBusinessInfo(), string.Empty);
            }
            else
            {
                RAM.Alert("操作无效!" + errorMessage);
            }
        }
Example #13
0
        /// <summary>绑定数据源
        /// </summary>
        protected void RadGridProcurementCompactQuantity_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            IList <ProcurementCompactQuantityInfo> list = new List <ProcurementCompactQuantityInfo>();

            if (IsPostBack)
            {
                var personnel = CurrentSession.Personnel.Get();
                if (personnel == null)
                {
                    RAM.Alert("系统提示:无法获取当前登录人信息,请尝试重新登录后再操作!");
                    return;
                }
                var companyId = new Guid(RCB_Company.SelectedValue);
                var result    = _personIdList.Contains(personnel.PersonnelId);
                if (companyId == Guid.Empty && !result)
                {
                    list = _procurementCompactQuantityDal.GetProcurementCompactQuantityList(DateYear);
                }
                else if (companyId != Guid.Empty && !result)
                {
                    list = _procurementCompactQuantityDal.GetProcurementCompactQuantityList(DateYear, companyId);
                }
                else if (companyId == Guid.Empty && result)
                {
                    list = _procurementCompactQuantityDal.GetProcurementCompactQuantityList(personnel.PersonnelId, DateYear);
                }
                else if (companyId != Guid.Empty && result)
                {
                    list = _procurementCompactQuantityDal.GetProcurementCompactQuantityList(DateYear, companyId, personnel.PersonnelId);
                }
            }
            RadGridProcurementCompactQuantity.DataSource = list.OrderBy(ent => ent.CompanyName).ToList();
        }
Example #14
0
        private void LoadShowData()
        {
            var personnel = CurrentSession.Personnel.Get();

            if (personnel == null)
            {
                RAM.Alert("系统提示:无法获取当前登录人信息,请尝试重新登录后再操作!");
                return;
            }
            IList <CompanyCussentInfo> list = _personIdList.Contains(personnel.PersonnelId) ? _purchaseSet.GetCompanyIds(personnel.PersonnelId) : _companyCussent.GetCompanyCussentList(CompanyType.Suppliers, State.Enable);

            RCB_Company.DataSource     = list;
            RCB_Company.DataTextField  = "CompanyName";
            RCB_Company.DataValueField = "CompanyId";
            RCB_Company.DataBind();
            RCB_Company.Items.Insert(0, new RadComboBoxItem("全部供应商", Guid.Empty.ToString()));
            RCB_Company.SelectedIndex = 0;

            //加载年份
            var year = DateTime.Now.Year;

            for (var i = year - 1; i <= year + 1; i++)
            {
                RCB_Year.Items.Add(new RadComboBoxItem(string.Format("{0}", i), string.Format("{0}", i)));
            }
            RCB_Year.SelectedValue = string.Format("{0}", year);
            var str = year + "年" + DateTime.Now.Month + "月采购金额";

            RadGridProcurementCompactQuantity.MasterTableView.Columns.FindByUniqueName("TheMonthProcurementMoney").HeaderText = str;
        }
Example #15
0
        //核准
        protected void BtnPassClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txt_Fees.Text.Trim()))
            {
                RAM.Alert("手续费不能为空!");
                return;
            }

            if (string.IsNullOrEmpty(txt_TransactionNumber.Text.Trim()))
            {
                RAM.Alert("交易号不能为空!");
                return;
            }


            if (string.IsNullOrEmpty(RCB_AccountID.SelectedValue.Trim()))
            {
                RAM.Alert("资金账户不能为空!");
                return;
            }
            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                bool result = SaveData(true);
                if (!result)
                {
                    RAM.Alert("提交失败!");
                    return;
                }

                WebControl.AddOperationLog(Personnel.PersonnelId, Personnel.RealName, ApplyId, "",
                                           OperationPoint.MemberWithdrawCash.PaySuccess.GetBusinessInfo(), string.Empty);
                ts.Complete();
            }
            RAM.ResponseScripts.Add("CloseAndRebind()");
        }
Example #16
0
 //编辑选择的往来的单位分类
 protected void EditItem(object sender, EventArgs e)
 {
     if (TV_CompanyClass.SelectedNode != null)
     {
         RadTreeNode currentNode    = TV_CompanyClass.SelectedNode;
         var         companyClassId = new Guid(currentNode.Value);
         if (companyClassId != Guid.Empty)
         {
             NonceCompanyClass            = _companyClass.GetCompanyClass(companyClassId);
             ControlPanel.Visible         = false;
             IB_Add.Visible               = false;
             LBAddSpace.Visible           = false;
             IB_Update.Visible            = true;
             LBUpdateSpace.Visible        = true;
             IB_Cancel.Visible            = true;
             TB_CompanyClassCode.ReadOnly = false;
             TB_CompanyClassName.ReadOnly = false;
         }
         else
         {
             RAM.Alert("根节点不允许编辑。");
         }
     }
     else
     {
         RAM.Alert("您没有选择要编辑的往来单位分类!\n\n请从左边的往来单位分类树中选择要编辑的往来单位分类。");
     }
 }
Example #17
0
        protected void StockGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            long recordCount = 0;
            IList <StorageRecordInfo> list = new List <StorageRecordInfo>();

            if (IsPostBack)
            {
                //获取授权仓库列表
                var warehouseList = CurrentSession.Personnel.WarehouseList;
                if (warehouseList.Count == 0)
                {
                    RAM.Alert("没有授权的仓库,无法查询。");
                }
                else
                {
                    var startPage = StockGrid.CurrentPageIndex + 1;
                    int pageSize  = StockGrid.PageSize;

                    List <StorageRecordType> storageRecordTypes = new List <StorageRecordType>();
                    if (SStockType != default(Int32))
                    {
                        storageRecordTypes.Add((StorageRecordType)SStockType);
                    }
                    List <StorageRecordState> storageRecordStates = new List <StorageRecordState> {
                        StorageRecordState.Finished
                    };
                    list = _storageRecordDao.GetStorageRecordListToPages(WarehouseId, CompanyId, TB_GoodsName.Text.Trim(), OrderNof.Trim(), storageRecordTypes, storageRecordStates, default(Int32),
                                                                         default(Guid), StartTime, EndTime, 0, GlobalConfig.KeepYear, startPage, pageSize, out recordCount);
                }
            }
            StockGrid.DataSource       = list;
            StockGrid.VirtualItemCount = (int)recordCount;
        }
Example #18
0
        //添加往来单位分类
        protected void Add_Click(object sender, EventArgs e)
        {
            if (NonceCompanyClass == null)
            {
                return;
            }
            CompanyClassInfo companyClassInfo = NonceCompanyClass;

            try
            {
                _companyClass.Insert(companyClassInfo);
                if (TV_CompanyClass.SelectedNode == null)
                {
                    RadTreeNode addNode =
                        CreateNode(companyClassInfo.CompanyClassName + "(" + companyClassInfo.CompanyClassCode + ")",
                                   false, companyClassInfo.CompanyClassId.ToString());
                    TV_CompanyClass.Nodes.Add(addNode);
                }
                else
                {
                    RadTreeNode currentNode = TV_CompanyClass.SelectedNode;
                    RadTreeNode addNode     =
                        CreateNode(companyClassInfo.CompanyClassName + "(" + companyClassInfo.CompanyClassCode + ")",
                                   false, companyClassInfo.CompanyClassId.ToString());
                    currentNode.Nodes.Add(addNode);
                    currentNode.Expanded = true;
                }
                InsterItem(sender, e);
            }
            catch
            {
                RAM.Alert("往来单位分类添加失败!");
            }
        }
        /// <summary>保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_UpdateGoods(object sender, EventArgs e)
        {
            var index = RadMultiPage1.SelectedIndex;
            ShopActivityImageInfo shopActivityImageInfo;

            switch (index)
            {
            case 0:    //网站
                shopActivityImageInfo = new ShopActivityImageInfo
                {
                    ShopActivityImage     = Editor_DescriptionWeb.Content,
                    ShopActivityImageType = (int)ShopActivityImageType.Web
                };
                break;

            case 1:    //手机
                shopActivityImageInfo = new ShopActivityImageInfo
                {
                    ShopActivityImage     = Editor_DescriptionPhone.Content,
                    ShopActivityImageType = (int)ShopActivityImageType.Phone
                };
                break;

            default:
                shopActivityImageInfo = null;
                break;
            }
            if (shopActivityImageInfo == null)
            {
                return;
            }
            var result = _activityImageDalWrite.InsertOrUpdate(shopActivityImageInfo);

            RAM.Alert(result ? "保存成功" : "保存失败");
        }
Example #20
0
        //编辑分类
        protected void Update_Click(object sender, EventArgs e)
        {
            CompanyClassInfo companyClassInfo = NonceCompanyClass;

            if (companyClassInfo.CompanyClassId != Guid.Empty)
            {
                try
                {
                    if (TV_CompanyClass.SelectedNode != null)
                    {
                        _companyClass.Update(companyClassInfo);
                        RadTreeNode currentNode = TV_CompanyClass.SelectedNode;
                        currentNode.Text = companyClassInfo.CompanyClassName + "(" + companyClassInfo.CompanyClassCode +
                                           ")";
                        currentNode.ToolTip = companyClassInfo.CompanyClassName + "(" +
                                              companyClassInfo.CompanyClassCode + ")";
                    }
                }
                catch
                {
                    RAM.Alert("往来单位分类更改失败!");
                }
            }
            else
            {
                RAM.Alert("根节点不允许更改!");
            }
        }
Example #21
0
        protected void TempRadGrid_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = e.Item as GridEditableItem;

            if (editedItem != null)
            {
                var    tempId         = new Guid(editedItem.GetDataKeyValue("TempId").ToString());
                string templateName   = ((TextBox)editedItem.FindControl("TB_TemplateName")).Text;
                string shipper        = ((TextBox)editedItem.FindControl("TB_Shipper")).Text;
                string contactPerson  = ((TextBox)editedItem.FindControl("TB_ContactPerson")).Text;
                string contactAddress = ((TextBox)editedItem.FindControl("TB_ContactAddress")).Text;
                string remarks        = ((TextBox)editedItem.FindControl("TB_Remarks")).Text;
                string customer       = ((TextBox)editedItem.FindControl("TB_Customer")).Text;
                var    tempInfo       = new ExcelTemplateInfo
                {
                    TempId         = tempId,
                    TemplateName   = templateName,
                    Shipper        = shipper,
                    ContactPerson  = contactPerson,
                    ContactAddress = contactAddress,
                    Customer       = customer,
                    Remarks        = remarks,
                    WarehouseId    = new Guid(RCB_Stock.SelectedValue)
                };
                try
                {
                    _temp.Update(tempInfo);
                }
                catch (Exception ex)
                {
                    RAM.Alert("修改失败!可能修改的模板名存在相同的!" + ex.Message);
                }
            }
        }
Example #22
0
        /// <summary>删除基本单位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UnitsGrid_DeleteCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = e.Item as GridEditableItem;

            if (editedItem != null)
            {
                var webRudderInfo = _webRudder.GetWebRudder();
                var unitsId       = new Guid(editedItem.GetDataKeyValue("UnitsId").ToString());
                if (unitsId != webRudderInfo.DefaultUnitsId)
                {
                    try
                    {
                        _unitsWirte.Delete(unitsId);
                    }
                    catch
                    {
                        RAM.Alert("数量单位信息数据删除失败!");
                    }
                }
                else
                {
                    RAM.Alert("该数量单位为默认使用积分规则,不允许删除!");
                }
            }
        }
        /// <summary>
        /// 修改权限
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RG_Power_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            Ccb_CheckedChanged(e);
            var editedItem = e.Item as GridEditableItem;
            var info       = new CostReportAuditingInfo();

            if (editedItem != null)
            {
                info.PowerId            = new Guid(editedItem.GetDataKeyValue("PowerId").ToString());
                info.AuditingFilialeId  = new Guid(((DropDownList)editedItem.FindControl("DDL_Filiale")).SelectedValue);
                info.AuditingBranchId   = new Guid(((DropDownList)editedItem.FindControl("DDL_Branch")).SelectedValue);
                info.AuditingPositionId = new Guid(((DropDownList)editedItem.FindControl("DDL_Position")).SelectedValue);
            }
            info.MinAmount      = -1;
            info.MaxAmount      = -1;
            info.ReportBranchId = BranchID;
            if (editedItem != null)
            {
                info.Description = ((TextBox)editedItem.FindControl("TB_Description")).Text;
            }
            info.Kind = (int)CostReportAuditingType.Invoice;
            try
            {
                _costReportAuditingPower.UpdatePower(info);
                RG_Power.Rebind();
                CheckChanged = false;
            }
            catch (Exception ex)
            {
                RAM.Alert("权限修改失败!" + ex.Message);
            }
        }
        protected void RG_AvgSettlePrice_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (!IsPostBack)
            {
                var query = from goodsInfo in new List <GoodsInfo>()
                            let goodsStockPriceRecordInfo = new GoodsStockPriceRecordInfo()
                                                            select new
                {
                    goodsInfo.GoodsId,
                    goodsInfo.GoodsName,
                    goodsInfo.GoodsCode,
                    goodsStockPriceRecordInfo.DayTime,
                    goodsStockPriceRecordInfo.AvgSettlePrice
                };

                RG_AvgSettlePrice.DataSource = query.ToList();
            }
            else
            {
                if (string.IsNullOrEmpty(DDL_HostingFilialeAuth.SelectedValue) || DDL_HostingFilialeAuth.SelectedValue == Guid.Empty.ToString())
                {
                    RAM.Alert("请选择公司!");
                    return;
                }
                GridDataBind();
            }
        }
Example #25
0
        //批量受理提示(提示申请单总数、发票总数、收据总数)
        protected void btn_Accept_Click(object sender, EventArgs e)
        {
            Hid_ID.Value = string.Empty;
            if (Request["ckId"] != null)
            {
                var           datas  = Request["ckId"].Split(',');
                List <string> listID = new List <string>();
                foreach (var item in datas)
                {
                    listID.Add(item.Split('&')[0]);
                }

                if (listID.Count > 0)
                {
                    Hid_ID.Value = string.Join(",", listID.ToArray());
                    ArrayList arrayList = _SubsidyPaymentSerivce.GetSumList(Hid_ID.Value.Split(',').ToList());
                    if (arrayList.Count > 0)
                    {
                        lbl_Total.Text            = arrayList[0].ToString();
                        lbl_SumSubsidyAmount.Text = arrayList[1].ToString();
                    }
                }
            }
            else
            {
                RAM.Alert("请选择相关数据!");
                return;
            }
            MessageBox.AppendScript(this, "moveShow();ShowValue('" + Hid_ID.Value + "');");
        }
Example #26
0
        protected void Rg_BankWebSite_InsertCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem     = (GridEditableItem)e.Item;
            var bankAccountsId = new Guid(((DropDownList)editedItem.FindControl("DDL_Bank")).SelectedValue);

            TargetId = new Guid(RTVWebSite.SelectedValue);
            var bwInfo = new BankAccountInfo
            {
                BankAccountsId = bankAccountsId,
                TargetId       = TargetId
            };

            try
            {
                _bankAccountsWrite.InsertBindBankAccounts(TargetId, bankAccountsId);
            }
            catch
            {
                RAM.Alert("插入该资金账户失败!");
            }
            if (CacheCollection.SalePlatform.Get(bwInfo.TargetId) != null || CacheCollection.Filiale.IsB2CFiliale(bwInfo.TargetId))
            {
                try
                {
                    B2CSao.AddBankAccountBinding(bwInfo.TargetId, bwInfo.BankAccountsId);
                }
                catch (Exception exp)
                {
                    RAM.Alert("同步失败,错误信息:" + exp.Message);
                }
            }
        }
Example #27
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnDeleteClick(object sender, EventArgs e)
        {
            if (rgCheckHistory.SelectedItems.Count == 0)
            {
                RAM.Alert("请选择待删除帐!");
                return;
            }
            var deletes = new Dictionary <Guid, CheckDataRecordInfo>();

            foreach (GridDataItem item in rgCheckHistory.SelectedItems)
            {
                var checkId = new Guid(item.GetDataKeyValue("CheckId").ToString());
                var info    = _checkDataManagerWrite.GetCheckDataInfoById(checkId);
                if (info != null && info.CheckDataState < (int)CheckDataState.Confirmed)
                {
                    deletes.Add(checkId, info);
                }
            }
            if (deletes.Count < rgCheckHistory.SelectedItems.Count)
            {
                RAM.Alert("选择项中存在确认后对账记录/记录不存在!");
                return;
            }
            foreach (var delete in deletes.Keys)
            {
                _checkDataManagerWrite.UpdateState(delete, (int)CheckDataState.Deleted);
            }
            rgCheckHistory.Rebind();
        }
Example #28
0
 //编辑选择的商品分类
 protected void EditItem(object sender, EventArgs e)
 {
     if (TVGoodsClass.SelectedNode != null)
     {
         RadTreeNode currentNode = TVGoodsClass.SelectedNode;
         var         classId     = new Guid(currentNode.Value);
         if (classId != Guid.Empty)
         {
             var goodsClassInfo = _goodsCenterSao.GetClassDetail(classId);
             NonceGoodsClassInfo    = goodsClassInfo;
             GoodsClassFieldIdList  = goodsClassInfo.GoodsClassFieldList;
             ControlPanel.Visible   = false;
             IB_Add.Visible         = false;
             LB_AddSpace.Visible    = false;
             IB_Update.Visible      = true;
             LB_UpdateSpace.Visible = true;
             IB_Cancel.Visible      = true;
             DisableGoodsClassPanel(false);
         }
         else
         {
             RAM.Alert("根节点不允许编辑。");
         }
     }
     else
     {
         RAM.Alert("您没有选择要编辑的商品分类!\n\n请从左边的商品分类树中选择要编辑的项。");
     }
 }
Example #29
0
        /// <summary>导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ExportExcelClick(object sender, EventArgs e)
        {
            var goodsKingdType = Convert.ToInt32(RCB_GoodsKingType.SelectedValue);
            var goodsBrandId   = new Guid(RCB_GoodsBrand.SelectedValue);

            SearchGoodsNameOrCode = TBox_SearchGoodsNameOrCode.Text.Trim();
            if (goodsBrandId == Guid.Empty && string.IsNullOrWhiteSpace(SearchGoodsNameOrCode) && goodsKingdType == 0)
            {
                RAM.Alert("温馨提示:至少满足一个搜索条件!");
                return;
            }
            _isSearchGoods = false;
            int? trueGoodsKindType = null;
            Guid?trueBrandId       = null;

            if (goodsKingdType != 0)
            {
                trueGoodsKindType = goodsKingdType;
            }
            if (goodsBrandId != Guid.Empty)
            {
                trueBrandId = goodsBrandId;
            }
            var goodsList = _goodsCenterSao.GetGoodsListAndGiftList(trueGoodsKindType, trueBrandId, SearchGoodsNameOrCode);

            if (goodsList != null && goodsList.Count > 0)
            {
                OutPutExcel(goodsList);
            }
        }
        protected void Button_InvoiceCommit_Click(object sender, EventArgs e)
        {
            if (RDP_StartTime.SelectedDate == null)
            {
                RAM.Alert("请选择起止日期!");
                return;
            }

            if (RcbKindType.SelectedValue == string.Format("{0}", (Byte)InvoiceKindType.Electron))
            {
                RAM.Alert("此功能只适用于纸质发票!");
                return;
            }

            if (RDP_EndTime.SelectedDate != null)
            {
                if (RDP_EndTime.SelectedDate >= DateTime.Now)
                {
                    RAM.Alert("报送结束日期不能大于等于今天");
                    return;
                }
            }

            if (RDP_EndTime.SelectedDate != null)
            {
                var filialeId = new Guid(RCB_FilialeList.SelectedValue);
                Invoice.WriteInstance.InvoiceCommit((DateTime)RDP_StartTime.SelectedDate, (DateTime)RDP_EndTime.SelectedDate, filialeId);
            }
            RAM.Alert("报送完成!");
            rad_invoce.Rebind();
        }