예제 #1
0
        public static Condition initialize()
        {
            Condition ShieldCondition = new Condition();

            ShieldCondition.AddCondition(SH_RIGHT_AV);
            ShieldCondition.AddCondition(SH_STICKING);

            return(ShieldCondition);
        }
예제 #2
0
        public static Condition initialize()
        {
            Condition SwordCondition = new Condition();

            SwordCondition.AddCondition(SW_LEFT_AV);
            SwordCondition.AddCondition(SW_STICKING);

            return(SwordCondition);
        }
예제 #3
0
        private void Search()
        {
            Condition condition = new Condition();

            condition.AddCondition("key", new object[] { this.lengthKey, this.widthKey }, ConditionItemRelation.IN);
            string cond = condition.ToString();

            try
            {
                string       url       = $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/tray/{condition.ToString()}";
                CommonData[] trayDates = RestClient.RequestPost <CommonData[]>(url, null, "GET");
                if (trayDates.Length == 2)
                {
                    if (trayDates[0].key == this.lengthKey && trayDates[1].key == this.widthKey)
                    {
                        this.textBoxLength.Text = trayDates[0].value;
                        this.textBoxWidth.Text  = trayDates[1].value;
                        this.mode = FormMode.ALTER;
                        this.commonDataLength.id = trayDates[0].id;
                        this.commonDataWidth.id  = trayDates[1].id;
                    }
                    else if (trayDates[1].key == this.lengthKey && trayDates[0].key == this.widthKey)
                    {
                        this.textBoxLength.Text = trayDates[1].value;
                        this.textBoxWidth.Text  = trayDates[0].value;
                        this.mode = FormMode.ALTER;
                        this.commonDataLength.id = trayDates[1].id;
                        this.commonDataWidth.id  = trayDates[0].id;
                    }
                    else
                    {
                        MessageBox.Show(("托位数据出错!"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    this.textBoxLength.Text = "";
                    this.textBoxWidth.Text  = "";
                    this.mode = FormMode.ADD;
                    this.commonDataLength.id = 0;
                    this.commonDataWidth.id  = 0;
                }
            }
            catch (WebException ex)
            {
                string message = ex.Message;
                if (ex.Response != null)
                {
                    message = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd();
                }
                MessageBox.Show(("获取托位信息失败") + "失败:" + message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #4
0
        private void buttonADD_Click_1(object sender, EventArgs e)
        {
            this.buttonADD.Focus();
            var startTime = this.model1[this.model1.SelectionRange.Row, "startTime"];

            try
            {
                string body = "{\"warehouseId\":\"" + GlobalData.Warehouse["id"] + "\",\"personId\":\"" + GlobalData.Person["id"] + "\",\"startTime\":\"" + startTime + "\"}";
                string url  = Defines.ServerURL + "/warehouse/" + GlobalData.AccountBook + "/account_period/carry_over";
                RestClient.RequestPost <List <IDictionary <string, object> > >(url, body);
                MessageBox.Show("结转成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                Condition condWarehouse = new Condition().AddCondition("warehouseId", GlobalData.Warehouse["id"]);
                GlobalData.AllAccountPeriod = RestClient.Get <List <IDictionary <string, object> > >(
                    $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_period/{condWarehouse.AddOrder("startTime", OrderItemOrder.DESC).ToString()}");

                try
                {
                    GlobalData.AccountPeriod = RestClient.Get <List <IDictionary <string, object> > >(
                        $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_period/{condWarehouse.AddCondition("ended", 0).AddOrder("startTime", OrderItemOrder.DESC).ToString()}")[0];
                }
                catch { GlobalData.AccountPeriod = null; }
            }
            catch (WebException ex)
            {
                string message = ex.Message;
                if (ex.Response != null)
                {
                    message = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd();
                }
                MessageBox.Show("结转失败:" + message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            this.Close();
        }
예제 #5
0
        private void toolStripButtonAlter_Click(object sender, EventArgs e)
        {
            if (this.synchronizer.Save())
            {
                Condition condWarehouse = new Condition().AddCondition("warehouseId", GlobalData.Warehouse["id"]);
                GlobalData.AllAccountPeriod = RestClient.Get <List <IDictionary <string, object> > >(
                    $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_period/{condWarehouse.AddOrder("startTime", OrderItemOrder.DESC).ToString()}");

                try
                {
                    GlobalData.AccountPeriod = RestClient.Get <List <IDictionary <string, object> > >(
                        $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_period/{condWarehouse.AddCondition("ended", 0).AddOrder("startTime", OrderItemOrder.DESC).ToString()}")[0];
                }
                catch { GlobalData.AccountPeriod = null; }
                this.searchView1.Search();
            }
        }
예제 #6
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }
            this.model1.RemoveSelectedRows();

            Condition condAccountTitle = new Condition();

            GlobalData.AllAccountTitle = RestClient.Get <List <IDictionary <string, object> > >(
                $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_title/{condAccountTitle.AddCondition("enabled", 1)}");

            GlobalData.AllAccountTitleTure = RestClient.Get <List <IDictionary <string, object> > >(
                $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_title/{condAccountTitle.ToString()}");
        }
예제 #7
0
        private void toolStripButtonAlter_Click(object sender, EventArgs e)
        {
            if (this.synchronizer.Save())
            {
                this.searchView1.Search();

                Condition condAccountTitle = new Condition();

                GlobalData.AllAccountTitle = RestClient.Get <List <IDictionary <string, object> > >(
                    $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/pay_note/{condAccountTitle.AddCondition("enabled", 1)}/find_son");

                GlobalData.AllAccountTitleTure = RestClient.Get <List <IDictionary <string, object> > >(
                    $"{Defines.ServerURL}/warehouse/{GlobalData.AccountBook}/account_title/{condAccountTitle.ToString()}");
            }
        }