示例#1
0
        public static void Houssam_Plugin_Func()
        {
            try
            {
                if (frmInput == null)
                {
                    frmInput = new FrmInput();
                }
                frmInput.IsOK = false;
                frmInput.Show();
                //NppTbData _nppTbData = new NppTbData();
                //_nppTbData.hClient = frm.Handle;
                //_nppTbData.pszName = "Go To Line #";
                //_nppTbData.dlgID = 15;

                //_nppTbData.uMask = NppTbMsg.DWS_DF_CONT_RIGHT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR;
                //_nppTbData.hIconTab = (uint)tbIcon.Handle;
                //_nppTbData.pszModuleName = PluginName;
                //IntPtr _ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(_nppTbData));
                //Marshal.StructureToPtr(_nppTbData, _ptrNppTbData, false);

                //Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMREGASDCKDLG, 0, _ptrNppTbData);
                // Following message will toogle both menu item state and toolbar button
                //Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SETMENUITEMCHECK, PluginBase._funcItems.Items[idFrmGotToLine]._cmdID, 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }



            /*frm.Show();
             */
        }
示例#2
0
        private void lbtClose_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Closing Date");

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                int        id = (int)lsvStatus.SelectedItems[0].Tag;
                SiteStatus ss;
                if (id > 0)
                {
                    ss = _site.GetSiteStatusById(id);
                }
                else
                {
                    ss = (SiteStatus)_site.SiteStatuses[lsvStatus.SelectedItems[0].Index];
                }
                ss.ClosedOn = frm.GetDateTimeValue();

                //DataRepository.SaveOrUpdateSite(_site);
                PopStatus();

                if (OnDataUsageEdit != null)
                {
                    OnDataUsageEdit(this, new EventArgs());
                }
            }
        }
示例#3
0
        private void lbtEditstatus_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Opening Date");

            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                if (lsvStatus.SelectedItems.Count > 0)
                {
                    int        id = (int)lsvStatus.SelectedItems[0].Tag;
                    SiteStatus ss;
                    if (id > 0)
                    {
                        ss = _site.GetSiteStatusById(id);
                    }
                    else
                    {
                        ss = (SiteStatus)_site.SiteStatuses[lsvStatus.SelectedItems[0].Index];
                    }
                    // DateTime closeDate = _site.GetLastClosedDate.Value;//b
                    // string closeDate = _site.GetLastClosedDate != null ? _site.GetLastClosedDate.Value.ToShortDateString() : "";
                    int    Count = _site.SiteStatuses.Count;
                    string closeDate;
                    closeDate = _site.SiteStatuses[Count - 1].ClosedOn != null ? _site.SiteStatuses[Count - 1].ClosedOn.ToString() : "";

                    if (closeDate != "")                                        //b
                    {
                        if (DateTime.Parse(closeDate) < frm.GetDateTimeValue()) //b
                        {
                            ss.OpenedFrom = frm.GetDateTimeValue();

                            //DataRepository.SaveOrUpdateSite(_site);
                            PopStatus();
                        }
                        else
                        {
                            MessageBox.Show("Opening Date can not be after Closing Date.");
                        }
                    }
                    else
                    {
                        ss.OpenedFrom = frm.GetDateTimeValue();
                        //DataRepository.SaveOrUpdateSite(_site);
                        PopStatus();
                    }
                    if (OnDataUsageEdit != null)
                    {
                        OnDataUsageEdit(this, new EventArgs());
                    }
                }
            }
        }
示例#4
0
        private void lbtOpen_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Opening Date");

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                SiteStatus ss = new SiteStatus();
                ss.OpenedFrom = frm.GetDateTimeValue();
                _site.SiteStatuses.Add(ss);
                //DataRepository.SaveOrUpdateSite(_site);
                PopStatus();

                if (OnDataUsageEdit != null)
                {
                    OnDataUsageEdit(this, new EventArgs());
                }
            }
        }
        private void btn保存_Click(object sender, EventArgs e)
        {
            string closereson = "";

            if (IsRowClose)
            {
                if (!MsgHelper.AskQuestion("确定要关闭选择的明细行吗?"))
                {
                    return;
                }

                FrmInput input = new FrmInput();
                if (input.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                closereson = input.Content;
            }


            int count = 0;
            List <ICPRBILLENTRYMODEL> list = new List <ICPRBILLENTRYMODEL>();

            for (int i = 0; i < gridView请购计划明细.RowCount; i++)
            {
                bool b = gridView请购计划明细.GetRowCellValue(i, "FCHECK").ToBool();
                if (b)
                {
                    string fid = gridView请购计划明细.GetRowCellValue(i, "FID").ToStr();
                    //string commitqty = gridView请购计划明细.GetRowCellValue(i, "FCOMMITQTY").ToStr();
                    string orderremark1 = gridView请购计划明细.GetRowCellValue(i, "FORDERREMARK1").ToStr();
                    string orderremark2 = gridView请购计划明细.GetRowCellValue(i, "FORDERREMARK2").ToStr();

                    list.Add(new ICPRBILLENTRYMODEL()
                    {
                        FID           = fid,
                        FORDERREMARK1 = orderremark1,
                        FORDERREMARK2 = orderremark2
                    });


                    if (list.Count == 50)
                    {
                        bool ret = _service.CloseSave(list.ToArray(), Global.LoginUser, closereson);
                        if (ret)
                        {
                            list = new List <ICPRBILLENTRYMODEL>();
                        }
                    }

                    count++;
                }
            }

            _service.UpdateICPRBILL(new ICPRBILLMODEL()
            {
                FID = _icprbillid, FIDENTIFICATION = txt标识.Text
            });
            if (SaveAfter != null)
            {
                SaveAfter(null, null);
            }


            if (list.Count == 0)
            {
                this.Close();
                //MsgHelper.ShowError("请勾选要处理的数据!");
                return;
            }

            if (IsRowClose)
            {
                if (MsgHelper.AskQuestion("确定要关闭选择的明细行吗?"))
                {
                    bool ret = _service.CloseSave(list.ToArray(), Global.LoginUser, closereson);
                    if (ret)
                    {
                        MsgHelper.ShowInformation("处理成功!");
                        this.DialogResult = DialogResult.OK;
                    }
                }
            }
            else
            {
                bool ret = _service.ConfirmSave("", list.ToArray(), Global.LoginUser);
                if (ret)
                {
                    MsgHelper.ShowInformation("保存成功!");

                    //this.Close();
                }
            }
        }
示例#6
0
        private void lbtOpen_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Opening Date");
            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                SiteStatus ss = new SiteStatus();
                ss.OpenedFrom = frm.GetDateTimeValue();
                _site.SiteStatuses.Add(ss);
                //DataRepository.SaveOrUpdateSite(_site);
                PopStatus();

                if (OnDataUsageEdit != null)
                {
                    OnDataUsageEdit(this, new EventArgs());
                }
            }
        }
示例#7
0
        private void lbtEditstatus_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Opening Date");
            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                if (lsvStatus.SelectedItems.Count > 0)
                {

                    int id = (int)lsvStatus.SelectedItems[0].Tag;
                    SiteStatus ss;
                    if (id > 0)
                        ss = _site.GetSiteStatusById(id);
                    else
                        ss = (SiteStatus)_site.SiteStatuses[lsvStatus.SelectedItems[0].Index];
                   // DateTime closeDate = _site.GetLastClosedDate.Value;//b
                   // string closeDate = _site.GetLastClosedDate != null ? _site.GetLastClosedDate.Value.ToShortDateString() : "";
                    int Count = _site.SiteStatuses.Count;
                    string closeDate;
                    closeDate = _site.SiteStatuses[Count - 1].ClosedOn != null ? _site.SiteStatuses[Count - 1].ClosedOn.ToString() : "";

                    if (closeDate != "")//b
                    {
                        if (DateTime.Parse(closeDate) < frm.GetDateTimeValue())//b
                        {
                            ss.OpenedFrom = frm.GetDateTimeValue();

                            //DataRepository.SaveOrUpdateSite(_site);
                            PopStatus();
                        }
                        else
                        {
                            MessageBox.Show("Opening Date can not be after Closing Date.");
                        }
                    }
                    else
                    {
                    ss.OpenedFrom = frm.GetDateTimeValue();
                    //DataRepository.SaveOrUpdateSite(_site);
                    PopStatus();
                     }
                    if (OnDataUsageEdit != null)
                    {
                        OnDataUsageEdit(this, new EventArgs());
                    }
                }
            }
        }
示例#8
0
        private void lbtClose_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Closing Date");
            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                if (lsvStatus.SelectedItems.Count > 0)
                {
                    int id = (int)lsvStatus.SelectedItems[0].Tag;

                    SiteStatus ss;
                    if (id > 0)
                        ss = _site.GetSiteStatusById(id);
                    else
                        ss = (SiteStatus)_site.SiteStatuses[lsvStatus.SelectedItems[0].Index];
                    DateTime openDate = _site.GetLastOpenDate;//b
                    if (openDate <= frm.GetDateTimeValue())//b
                    {
                        ss.ClosedOn = frm.GetDateTimeValue();
                        PopStatus();
                    }
                    else
                    {
                        MessageBox.Show("Closing Date can not be before Opening Date.");
                    }

                    //DataRepository.SaveOrUpdateSite(_site);

                    if (OnDataUsageEdit != null)
                    {
                        OnDataUsageEdit(this, new EventArgs());
                    }
                }
            }
        }
示例#9
0
        private void lbtEditstatus_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmInput frm = new FrmInput(DateTime.Now, "Opening Date");
            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                int id = (int)lsvStatus.SelectedItems[0].Tag;
                SiteStatus ss;
                if (id > 0)
                    ss = _site.GetSiteStatusById(id);
                else
                    ss = (SiteStatus)_site.SiteStatuses[lsvStatus.SelectedItems[0].Index];

                ss.OpenedFrom = frm.GetDateTimeValue();

                //DataRepository.SaveOrUpdateSite(_site);
                PopStatus();

                if (OnDataUsageEdit != null)
                {
                    OnDataUsageEdit(this, new EventArgs());
                }
            }
        }