Пример #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try {
         if (this.allowUpdate)
         {
             if ((this.btnOK.Text == "更新") || (this.btnOK.Text == "设置"))
             {
                 this.rbtAllPages.Enabled = true;
                 this.groupBox1.Enabled   = true;
                 this.groupBox2.Enabled   = true;
                 if (!this.hasNextPage)
                 {
                     this.cmbNextPageCol.Enabled = false;
                 }
                 this.btnOK.Text = "确定";
             }
             else if (this.btnOK.Text == "确定")
             {
                 string attrValue = PPCardCompiler.CreateXML(this.NumberFormat);
                 this.m_tp.Item.Iteration.SetAttrValue("AUTONUMBER", attrValue);
                 PLItem.UpdateItemIterationDirectly(this.m_tp.Item, this.m_tp.UserOid, false);
                 base.DialogResult = DialogResult.OK;
             }
         }
         else
         {
             AutoNumber numberFormat = this.NumberFormat;
             base.DialogResult = DialogResult.OK;
         }
     } catch {
         MessageBox.Show("自动编号设置出错。", ConstCommon.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Пример #2
0
 private void Save()
 {
     this._theItem.Iteration = PLItem.UpdateItemIterationDirectly(this._theItem, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false);
     if (BizItemHandlerEvent.Instance.D_AfterIterationUpdated != null)
     {
         BizItemHandlerEvent.Instance.D_AfterIterationUpdated(BizOperationHelper.ConvertPLMBizItemDelegateParam(this._theItem));
     }
 }
Пример #3
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.readOnly)
     {
         base.DialogResult = DialogResult.Cancel;
         base.Close();
     }
     else if (this.pro.UpdateData(false))
     {
         this.Item = this.pro.Item;
         if (this.pro.Item.Master.ClassName == "PPCRDTEMPLATE")
         {
             CLCardTemplate template = new CLCardTemplate(this.uOid, false, false, this.Item)
             {
                 HasCover    = this.chkCover.Checked,
                 HasMainPage = this.chkMainPage.Checked,
                 HasNextPage = this.chkNextPage.Checked
             };
             try {
                 template.CheckProperties();
             } catch (Exception exception) {
                 if (MessageBox.Show(exception.Message + "\n现在改正这些错误吗?选择“否”,将在下次提醒您更正该模板中的错误。", "PPM提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                 {
                     return;
                 }
             }
             Cursor current = Cursor.Current;
             Cursor.Current = Cursors.WaitCursor;
             try {
                 if (this.updateDirectely)
                 {
                     template.Item.Iteration = PLItem.UpdateItemIterationDirectly(template.Item, this.uOid, false);
                 }
                 else
                 {
                     template.Item.Iteration = PLItem.UpdateItemIteration(template.Item.Iteration, this.uOid, false);
                 }
             } catch (Exception exception2) {
                 MessageBox.Show("更新模板属性失败!\n" + exception2.Message, "PPC - FrmBrowse", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 return;
             } finally {
                 Cursor.Current = current;
             }
             BizItemHandlerEvent.Instance.D_AfterIterationUpdated(BizOperationHelper.ConvertPLMBizItemDelegateParam(template.Item));
         }
         base.DialogResult = DialogResult.OK;
         base.Close();
     }
 }
Пример #4
0
 private void OnClearAutoNumber(object sender, EventArgs e)
 {
     if ((this.m_tp.Item.State == ItemState.CheckIn) || (this.m_tp.Item.State == ItemState.Release))
     {
         if (MessageBox.Show("卡片处于" + this.m_tp.Item.StateLabel + "状态,选择“是”,将清除模板的自动编号规则,是否继续清除?", "卡片模板", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             this.m_tp.AutoNumber = null;
             PLItem.UpdateItemIterationDirectly(this.m_tp.Item, this.m_tp.UserOid, false);
         }
     }
     else
     {
         this.m_tp.AutoNumber = null;
         this.m_tp.IsSaved    = false;
     }
 }
Пример #5
0
        private void D_TOPRINT_TSD_Click(object sender, EventArgs e)
        {
            ArrayList lstItems = new ArrayList();

            foreach (ListViewItem item in this.lvwTSD.SelectedItems)
            {
                DEBusinessItem tag = item.Tag as DEBusinessItem;
                if ((tag.State == ItemState.CheckOut) && (tag.Holder == ClientData.LogonUser.Oid))
                {
                    PLItem.Agent.CheckIn(tag.MasterOid, tag.ClassName, ClientData.LogonUser.Oid, "");
                    lstItems.Add(tag);
                }
                if (tag.State == ItemState.CheckIn)
                {
                    lstItems.Add(tag);
                }
            }
            if (lstItems.Count == 0)
            {
                MessageBox.Show("没有能够打印的托晒单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
            }
            else
            {
                StringBuilder builder;
                ArrayList     list2 = PlArchivManage.Agent.CheckTsdRight(lstItems, "ToPrint", out builder, "托晒");
                if (list2.Count == 0)
                {
                    FrmArchivManage.frmMian.DisplayTextInRichtBox("没有数据可以发送打印:\r\n" + builder.ToString(), 0, true);
                }
                else
                {
                    if (builder.Length > 0)
                    {
                        DialogResult result = MessageBox.Show("发现数据错误,见详细信息中的内容,是否继续?", "发送打印错误", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        FrmArchivManage.frmMian.DisplayTextInRichtBox("下列数据无法 发送打印:\r\n" + builder.ToString(), 0, result == DialogResult.No);
                        if (result != DialogResult.Yes)
                        {
                            return;
                        }
                    }
                    StringBuilder builder2 = new StringBuilder();
                    for (int i = 0; i < list2.Count; i++)
                    {
                        StringBuilder  builder3;
                        DEBusinessItem item3 = list2[i] as DEBusinessItem;
                        PlArchivManage.Agent.PrintOrSentTsd(ClientData.LogonUser.Oid, item3, "ToPrint", out builder3);
                        if (builder3.Length > 0)
                        {
                            builder.Append(builder3.ToString());
                        }
                        else
                        {
                            item3 = PLItem.Agent.GetBizItem(item3.MasterOid, 0, 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem;
                            string attrValue = (item3.Iteration.GetAttrValue("SM") == null) ? "" : item3.Iteration.GetAttrValue("SM").ToString();
                            attrValue = attrValue + " " + ClientData.LogonUser.Name + ":发送打印";
                            item3.Iteration.SetAttrValue("SM", attrValue);
                            item3.Iteration = PLItem.UpdateItemIterationDirectly(item3, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false);
                            if (BizItemHandlerEvent.Instance.D_AfterIterationUpdated != null)
                            {
                                BizItemHandlerEvent.Instance.D_AfterIterationUpdated(BizOperationHelper.ConvertPLMBizItemDelegateParam(item3));
                            }
                            builder2.Append("\t" + item3.Id);
                        }
                    }
                    if (builder.Length > 0)
                    {
                        FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单发送打印没有成功\r\n" + builder.ToString(), 0, true);
                    }
                    if (builder2.Length > 0)
                    {
                        FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单发送打印成功\r\n" + builder2.ToString(), 1, true);
                    }
                }
            }
        }