コード例 #1
0
    private void saveccbillData()
    {
        CCInfo ccInfo = currentccbillData();

        try
        {
            bool   IsTrans  = true;
            string strError = string.Empty;
            bool   saved    = new CCService().SetCCInfo(loggingSessionInfo, ccInfo, IsTrans, out strError);
            if (saved)
            {
                this.Redirect("保存成功", InfoType.Info, this.Request.QueryString["from"] ?? "cc_bill_query.aspx");
            }
            else
            {
                this.InfoBox.ShowPopError(strError);
            }
            this.CCDetailInfoList = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(ccInfo.CCDetailInfoList);
        }
        catch (Exception ex)
        {
            this.InfoBox.ShowPopError("访问数据库出错!");
            this.CCDetailInfoList = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(ccInfo.CCDetailInfoList);
        }
    }
コード例 #2
0
        /// <summary>
        /// 批量保存盘点单:分两种,一种门店已经审批,一种门店未审批
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="Unit_Id">门店标识</param>
        /// <param name="User_Id">用户标识</param>
        /// <param name="ccList">盘点单集合</param>
        /// <returns></returns>
        public bool SetCCInfoList(string Customer_Id, string Unit_Id, string User_Id, IList <CCInfo> ccList)
        {
            string strError = string.Empty;

            try
            {
                LoggingSessionInfo loggingSessionInfo = GetLoggingSessionInfo(Customer_Id, User_Id, Unit_Id);
                CCService          ccService          = new CCService();
                foreach (CCInfo ccInout in ccList)
                {
                    ccInout.if_flag = "1";
                }
                bool bReturn = ccService.SetCCInfoList(loggingSessionInfo, ccList, out strError);
                if (bReturn)
                {
                    return(bReturn);
                }
                else
                {
                    throw new Exception(string.Format(strError, strError));
                }
            }
            catch (Exception ex)
            {
                strError = ex.ToString();
                throw (ex);
            }
        }
コード例 #3
0
        /// <summary>
        /// 获取库存盘点单主信息
        /// </summary>
        public string GetCcInfoById()
        {
            var    inoutService = new CCService(CurrentUserInfo);
            CCInfo data;
            string content = string.Empty;

            string key = string.Empty;

            if (FormatParamValue(Request("order_id")) != null && FormatParamValue(Request("order_id")) != string.Empty)
            {
                key = FormatParamValue(Request("order_id")).ToString().Trim();
            }

            data = inoutService.GetCCInfoById(key, 10000, 0);

            var jsonData = new JsonData();

            jsonData.totalCount = data == null ? "0" : "1";
            jsonData.data       = data;

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.ToJSON(),
                                    data == null ? "0" : "1");

            return(content);
        }
コード例 #4
0
ファイル: cc_bill_query.aspx.cs プロジェクト: radtek/crm
 private void Query(int pageIndex)
 {
     try
     {
         var service   = new CCService();
         var querylist = service.SearchCCInfo(loggingSessionInfo, CurrentQueryCondition.order_no, CurrentQueryCondition.status, CurrentQueryCondition.unit_id, CurrentQueryCondition.warehouse_id, CurrentQueryCondition.order_date_begin, CurrentQueryCondition.order_date_end, CurrentQueryCondition.complete_date_begin, CurrentQueryCondition.complete_date_end, CurrentQueryCondition.data_from_id
                                              , SplitPageControl1.PageSize
                                              , pageIndex * SplitPageControl1.PageSize);
         SplitPageControl1.RecoedCount = querylist.ICount;
         SplitPageControl1.PageIndex   = pageIndex;
         //验证查询当前页索引是否在记录总数范围内。
         if (SplitPageControl1.PageIndex != pageIndex)
         {
             Query(SplitPageControl1.PageIndex);
             return;
         }
         else
         {
             gvCcBill.DataSource = querylist.CCInfoList;
             gvCcBill.DataBind();
         }
     }
     catch (Exception ex)
     {
         PageLog.Current.Write(ex);
         this.InfoBox.ShowPopError("加载数据出错!");
     }
 }
コード例 #5
0
        /// <summary>
        /// 删除库存盘点单
        /// </summary>
        public string CcOrderDeleteData()
        {
            var    inoutService = new CCService(CurrentUserInfo);
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key = string.Empty;

            if (FormatParamValue(Request("ids")) != null && FormatParamValue(Request("ids")) != string.Empty)
            {
                key = FormatParamValue(Request("ids")).ToString().Trim();
            }

            if (key == null || key.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "单据ID不能为空";
                return(responseData.ToJSON());
            }

            string[] ids = key.Split(',');
            foreach (var id in ids)
            {
                inoutService.SetCCStatusUpdate(id.Trim(), BillActionType.Cancel, out error);
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
コード例 #6
0
    //查询商品明细(只有在新建页面的时候才可以用)
    private void searchccDetailInfo()
    {
        // string order_id = this.tbOrderNo.Text;
        string       unit_id      = this.selUnit.SelectedValue;
        string       warehouse_id = this.selWarehouse.SelectedValue;
        CCDetailInfo detailInfo   = new CCService().GetCCDetailListStockBalance(loggingSessionInfo, "", unit_id, warehouse_id, 1000
                                                                                , 0);
        IList <CCDetailInfo> itemDetailList = detailInfo.CCDetailInfoList;
        var currentData = saveItemDetailList();
        var afterFilter = currentData.Where(obj => !itemDetailList.Select(o => o.sku_id).Contains(obj.sku_id));
        var uionData    = itemDetailList.Union(afterFilter);

        this.CCDetailInfoList = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(uionData);
    }
コード例 #7
0
        /// <summary>
        /// 批量修改出入库单据上传标志
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <param name="User_Id">用户标识</param>
        /// <param name="ccInfoList">盘点单单据集合</param>
        /// <param name="if_flag">上传标志1=已经上传,0=未上传</param>
        /// <returns></returns>
        public bool SetInoutIfFlag(string Customer_Id, string Unit_Id, string User_Id, IList <CCInfo> ccInfoList, string if_flag)
        {
            LoggingSessionInfo loggingSessionInfo = GetLoggingSessionInfo(Customer_Id, User_Id, Unit_Id);
            bool bReturn = false;
            //IList<CCInfo> ccInfoList = new List<CCInfo>();
            //foreach (string orderId in OrderIds) {
            //    CCInfo ccInfo = new CCInfo();
            //    ccInfo.order_id = orderId;
            //    ccInfoList.Add(ccInfo);
            //}
            CCService ccService = new CCService();

            bReturn = ccService.SetCCIfFlag(loggingSessionInfo, if_flag, ccInfoList, true);
            return(bReturn);
        }
コード例 #8
0
    //显示查看和修改页面
    private void ShowccBillData(int pageIndex)
    {
        string orderid = this.Request.Params["order_id"].ToString();
        var    cclist  = new CCService().GetCCInfoById(loggingSessionInfo, orderid, 99999
                                                       , 0);

        this.tbOrderNo.Text        = cclist.order_no;
        this.selUnit.SelectedValue = cclist.unit_id;
        this.selUnit.SelectedText  = cclist.unit_name;
        initWarehouse();
        this.selWarehouse.SelectedValue = cclist.warehouse_id;
        this.selCompleteDate.Value      = cclist.complete_date;
        this.selOrderDate.Value         = cclist.order_date;
        this.tbRemark.Text    = cclist.remark;
        this.CCDetailInfoList = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(cclist.CCDetailInfoList);
    }
コード例 #9
0
        /// <summary>
        /// 查询库存盘点单
        /// </summary>
        public string GetCcOrderData()
        {
            var form      = Request("form").DeserializeJSONTo <CcOrderQueryEntity>();
            var ccService = new CCService(CurrentUserInfo);

            CCInfo data;
            string content = string.Empty;

            string order_no            = FormatParamValue(form.order_no);
            string status              = FormatParamValue(form.status);
            string unit_id             = FormatParamValue(Request("unit_id"));
            string warehouse_id        = FormatParamValue(form.warehouse_id);
            string order_date_begin    = FormatParamValue(form.order_date_begin);
            string order_date_end      = FormatParamValue(form.order_date_end);
            string complete_date_begin = FormatParamValue(form.complete_date_begin);
            string complete_date_end   = FormatParamValue(form.complete_date_end);
            string data_from_id        = FormatParamValue(form.data_from_id);
            int    maxRowCount         = PageSize;
            int    startRowIndex       = Utils.GetIntVal(FormatParamValue(Request("start")));

            string key = string.Empty;

            if (FormatParamValue(Request("id")) != null && FormatParamValue(Request("id")) != string.Empty)
            {
                key = FormatParamValue(Request("id")).ToString().Trim();
            }

            data = ccService.SearchCCInfo(CurrentUserInfo,
                                          order_no,
                                          status,
                                          unit_id,
                                          warehouse_id,
                                          order_date_begin,
                                          order_date_end,
                                          complete_date_begin,
                                          complete_date_end,
                                          data_from_id,
                                          maxRowCount,
                                          startRowIndex);

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.CCInfoList.ToJSON(),
                                    data.ICount);

            return(content);
        }
コード例 #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            //Deep Link
            if (Intent.HasExtra("al_applink_data"))
            {
                var appLinkData = Intent.GetStringExtra("al_applink_data");

                var alUrl = Intent.Data.ToString();
                Log.Info("Response", alUrl);
            }

            //Initialize with your secretKey
            CCBilleteraPayment cc = new CCBilleteraPayment("pKFe1P2iYw6z73srBDBx");


            //Add an Item with tax
            cc.addItem("item1", 100, 200, CCBilleteraPayment.IVA_REGULAR_16_);
            //Add an Item without tax
            cc.addItem("item1", 100, 200);

            //Add Total, description, netTotal, tax, tip
            cc.addTotal("total", 100, 200, 20);


            button = FindViewById <Button> (Resource.Id.myButton);

            button.Click += delegate {
                ccService = new CCService();
                ccService.setJson(cc.getJSON());
                ccService.setCallBack("parking://parking");

                try{
                    ccService.setSaveTokenListener(this);
                    ccService.getToken();
                }catch (Exception e) {
                    e.PrintStackTrace();
                }
            };
        }
コード例 #11
0
        /// <summary>
        /// 获取库存盘点单明细
        /// </summary>
        public string GetCcDetailInfoById()
        {
            var ccService             = new CCService(CurrentUserInfo);
            IList <CCDetailInfo> data = null;
            string content            = string.Empty;

            string order_id     = string.Empty;
            string unit_id      = string.Empty;
            string warehouse_id = string.Empty;

            if (FormatParamValue(Request("order_id")) != null && FormatParamValue(Request("order_id")) != string.Empty)
            {
                order_id = FormatParamValue(Request("order_id")).ToString().Trim();
            }
            if (FormatParamValue(Request("unit_id")) != null && FormatParamValue(Request("unit_id")) != string.Empty)
            {
                unit_id = FormatParamValue(Request("unit_id")).ToString().Trim();
            }
            if (FormatParamValue(Request("warehouse_id")) != null && FormatParamValue(Request("warehouse_id")) != string.Empty)
            {
                warehouse_id = FormatParamValue(Request("warehouse_id")).ToString().Trim();
            }

            int maxRowCount   = 100000;
            int startRowIndex = 0;

            if (order_id == null || order_id.Trim().Length == 0)
            {
                order_id = string.Empty;
            }
            CCInfo       order     = null;
            CCDetailInfo dataStock = null;

            if (order_id.Trim().Length > 0)
            {
                order = ccService.GetCCDetailInfoByOrderId(order_id, maxRowCount, startRowIndex);
            }
            else if (unit_id.Trim().Length > 0 && warehouse_id.Trim().Length > 0)
            {
                dataStock = ccService.GetCCDetailListStockBalance(CurrentUserInfo,
                                                                  order_id,
                                                                  unit_id,
                                                                  warehouse_id,
                                                                  maxRowCount,
                                                                  startRowIndex);
            }

            if (order != null)
            {
                data = order.CCDetailInfoList;
                foreach (var detailItem in order.CCDetailInfoList)
                {
                    detailItem.display_name = SkuService.GetItemAllName(detailItem);
                }
            }
            else if (dataStock != null)
            {
                data = dataStock.CCDetailInfoList;
                foreach (var detailItem in dataStock.CCDetailInfoList)
                {
                    detailItem.display_name = SkuService.GetItemAllName(detailItem);
                }
            }

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.ToJSON(),
                                    data.Count);

            return(content);
        }
コード例 #12
0
 public static IList <ContentClass> GetAllContentclass()
 {
     return(CCService.GetAllContentclass());
 }
コード例 #13
0
        /// <summary>
        /// 保存库存盘点单
        /// </summary>
        public string SaveCcOrder()
        {
            var    inoutService = new CCService(CurrentUserInfo);
            CCInfo order        = new CCInfo();
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key      = string.Empty;
            string order_id = string.Empty;

            if (FormatParamValue(Request("order")) != null && FormatParamValue(Request("order")) != string.Empty)
            {
                key = FormatParamValue(Request("order")).ToString().Trim();
            }
            if (FormatParamValue(Request("order_id")) != null && FormatParamValue(Request("order_id")) != string.Empty)
            {
                order_id = FormatParamValue(Request("order_id")).ToString().Trim();
            }

            order = key.DeserializeJSONTo <CCInfo>();

            if (order_id.Trim().Length == 0)
            {
                order.order_id = Utils.NewGuid();
            }
            else
            {
                order.order_id = order_id;
            }

            if (order.order_no == null || order.order_no.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "单据号码不能为空";
                return(responseData.ToJSON());
            }
            if (order.order_date == null || order.order_date.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "单据日期不能为空";
                return(responseData.ToJSON());
            }
            if (order.complete_date == null || order.complete_date.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "入库日期不能为空";
                return(responseData.ToJSON());
            }
            if (order.unit_id == null || order.unit_id.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "盘点单位不能为空";
                return(responseData.ToJSON());
            }
            if (order.warehouse_id == null || order.warehouse_id.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "仓库不能为空";
                return(responseData.ToJSON());
            }
            if (order.CCDetailInfoList == null || order.CCDetailInfoList.Count == 0)
            {
                responseData.success = false;
                responseData.msg     = "商品不能为空";
                return(responseData.ToJSON());
            }

            inoutService.SetCCInfo(order, false, out error);

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
コード例 #14
0
ファイル: cc_bill_query.aspx.cs プロジェクト: radtek/crm
    protected void gvCcBill_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        var serv = new CCService();

        try
        {
            switch (e.CommandName)
            {
            case "Page": return;

            case "Check":
            {
                if (serv.SetCCOrderStatus(loggingSessionInfo, e.CommandArgument.ToString(), BillActionType.Approve))
                {
                    this.InfoBox.ShowPopInfo("审批成功!");
                    Query(0);
                }
                else
                {
                    this.InfoBox.ShowPopError("审批失败!");
                }
            } break;

            case "Back":
            {
                if (serv.SetCCOrderStatus(loggingSessionInfo, e.CommandArgument.ToString(), BillActionType.Reject))
                {
                    this.InfoBox.ShowPopInfo("回退成功!");
                    Query(0);
                }
                else
                {
                    this.InfoBox.ShowPopError("回退失败!");
                }
            } break;

            case "cDelete":
            {
                if (serv.SetCCOrderStatus(loggingSessionInfo, e.CommandArgument.ToString(), BillActionType.Cancel))
                {
                    this.InfoBox.ShowPopInfo("删除成功!");
                    Query(0);
                }
                else
                {
                    this.InfoBox.ShowPopError("删除失败!");
                }
            } break;

            case "cCreateAj":
            {
                var service = new CCService();
                if (service.IsCCDifference(loggingSessionInfo, e.CommandArgument.ToString()))
                {
                    if (service.SetCCToAJ(loggingSessionInfo, e.CommandArgument.ToString()))
                    {
                        this.InfoBox.ShowPopInfo("生成调整单成功!");
                        //(sender as LinkButton).Visible = false;
                    }
                    else
                    {
                        this.InfoBox.ShowPopError("生成调整单失败!");
                    }
                }
                else
                {
                    this.InfoBox.ShowPopError("盘点单不存在有差异的sku,生成调整单失败!");
                }
                Query(0);
            } break;
            }
        }
        catch (Exception ex)
        {
            PageLog.Current.Write(ex);
            this.InfoBox.ShowPopError("加载数据出错!");
        }
    }
コード例 #15
0
 public static ContentClass GetContentclassById(int classid)
 {
     return(CCService.GetContentclassById(classid));
 }
コード例 #16
0
 public static int AddContentclass(ContentClass contentclass)
 {
     return(CCService.addContentclass(contentclass));
 }
コード例 #17
0
 public static int ModifyContentclass(ContentClass contentclass)
 {
     return(CCService.ModifyContentclass(contentclass));
 }
コード例 #18
0
 public static int DeleteContentClass(ContentClass contentclass)
 {
     return(CCService.DeleteContentClass(contentclass));
 }
コード例 #19
0
 public static Content GetContentByTId(int topicid)
 {
     return(CCService.GetContentByTId(topicid));
 }