public async Task AlterarMetrica(ContractClass <AutorizacaoMetrica> autorizacao)
 {
     var col          = GetOrCreate <Models.ContractClass <AutorizacaoMetrica> >(typeof(AutorizacaoMetrica).ToString());
     var updoneresult = await col.UpdateOneAsync(
         Builders <Models.ContractClass <AutorizacaoMetrica> > .Filter.Eq("Obj.Key", autorizacao.Obj.Key),
         Builders <Models.ContractClass <AutorizacaoMetrica> > .Update.Set("Obj.Status", autorizacao.Obj.Status));
 }
 public Contract(ContractClass relation, StrongNominal size, int now, int contractDays)
 {
     Class    = relation;
     Day      = now;
     Length   = contractDays;
     Deadline = now + contractDays;
     Nominal  = size;
     _formed  = false;
 }
        public void DataContractTest()
        {
            var d = new ContractClass ();
            d.MyProperty = "prop1";
            d.IgnoredMember = "abc";
            var s = JSON.ToJSON (d);
            Console.WriteLine (s);
            Assert.IsTrue (s.Contains ("myprop"));
            Assert.IsFalse (s.Contains ("IgnoredMember"));
            Assert.IsTrue (s.Contains ("privateField"));
            Assert.IsFalse (s.Contains ("\"Field\""));

            var o = JSON.ToObject<ContractClass> (s);
            Assert.AreEqual (d.MyProperty, o.MyProperty);
            Assert.AreEqual (o.IgnoredMember, null);
            Assert.AreEqual (d.Field, o.Field);
        }
        public void DataContractTest()
        {
            var d = new ContractClass();

            d.MyProperty    = "prop1";
            d.IgnoredMember = "abc";
            var s = JSON.ToJSON(d);

            Console.WriteLine(s);
            Assert.IsTrue(s.Contains("myprop"));
            Assert.IsFalse(s.Contains("IgnoredMember"));
            Assert.IsTrue(s.Contains("privateField"));
            Assert.IsFalse(s.Contains("\"Field\""));

            var o = JSON.ToObject <ContractClass> (s);

            Assert.AreEqual(d.MyProperty, o.MyProperty);
            Assert.AreEqual(o.IgnoredMember, null);
            Assert.AreEqual(d.Field, o.Field);
        }
Example #5
0
 protected void GVPermissionList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowIndex > -1)
     {
         DataRowView dataRowView = (DataRowView)e.Row.DataItem;
         e.Row.Cells[0].Text = (this.GVPermissionList.PageIndex * this.GVPermissionList.PageSize + (e.Row.RowIndex + 1)).ToString();
         TextBox textBox = (TextBox)e.Row.Cells[4].FindControl("txtPersSet");
         textBox.Attributes["readonly"] = "readonly";
         if (dataRowView["PermissionClass"].ToString() == "-1")
         {
             e.Row.Cells[3].Text = "默认";
         }
         if (dataRowView["PermissionClass"].ToString() == "0")
         {
             e.Row.Cells[3].Text = "以岗位设定权限";
             ContractClass contractClass = new ContractClass();
             textBox.Text = contractClass.GetDutyName((dataRowView["PermissionSet"].ToString().Trim() == "") ? "0" : dataRowView["PermissionSet"].ToString().Trim());
         }
         if (dataRowView["PermissionClass"].ToString() == "1")
         {
             e.Row.Cells[3].Text = "以个人设定权限";
             textBox.Text        = new DepositoryInfo().GetUserName(dataRowView["PermissionSet"].ToString().Trim());
         }
         e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);";
         e.Row.Attributes["onclick"]     = string.Concat(new object[]
         {
             "OnRecord(this);rowClick('",
             this.GVPermissionList.DataKeys[e.Row.RowIndex].Value,
             "','",
             dataRowView["PermissionClass"].ToString(),
             "','",
             dataRowView["PermissionSet"].ToString(),
             "','",
             textBox.Text,
             "');"
         });
     }
 }
Example #6
0
    //批准
    protected void Agree_Click(object sender, EventArgs e)
    {
        string id = ViewState["FormID"].ToString();
        WorkFlowInstance workFlowInstance = wf_WorkFlowInstance.GetWorkFlowInstanceByFormId(id);

        if (workFlowInstance != null)
        {
            //修改合同编号 2015-08-05 by yanghechun
            //2015-8-5 经办人确认生效
            //更新合同编号
            if (nodeName.Value == "经办人确认生效")
            {
                if (txtContract_No.Text.Trim() == "")
                {
                    Alert(Page, "合同编号不能为空,请输入!");
                    txtContract_No.Focus();
                    return;
                }
                try
                {
                    ContractClass contractClass = new ContractClass();
                    int biz_type = Convert.ToInt16(hf_biz_type.Value);
                    int biz_id = Convert.ToInt16(hf_biz_id.Value);
                    contractClass.UpdateContractNo(biz_type, biz_id, txtContract_No.Text.Trim());
                }
                catch
                {
                }
            }

            string action = "同意";
            bool isSuccess = WorkflowHelper.ApproveProcess(sn.Value, action, "founder\\" + _BPMContext.CurrentUser.LoginId);
            string Opinion = "";
            if (GetApproveOpinion(nodeName.Value) == null || GetApproveOpinion(nodeName.Value) == "")
            {
                Opinion = "同意";
            }
            else
            {
                Opinion = GetApproveOpinion(nodeName.Value);
            }
            string ApproveResult = "同意";
            string OpinionType = "";
            string IsSign = "0";
            string DelegateUserName = "";
            string DelegateUserCode = "";

            if (isSuccess && !(bool)ViewState["IsSubmit"])
            {
                var appRecord = new Pkurg.PWorldBPM.Business.Sys.WF_Approval_Record()
                {
                     ApprovalID = Guid.NewGuid().ToString(),
                     WFTaskID = int.Parse(taskID.Value),
                    FormID = id,
                    InstanceID = workFlowInstance.InstanceId,
                    Opinion = Opinion,
                    ApproveAtTime = DateTime.Now,
                    ApproveByUserCode = CurrentEmployee.EmployeeCode,
                    ApproveByUserName = CurrentEmployee.EmployeeName,
                    ApproveResult = ApproveResult,
                    OpinionType = OpinionType,
                    CurrentActiveName = nodeName.Value,
                    ISSign = IsSign,
                    CurrentActiveID= nodeID.Value,
                    DelegateUserName = DelegateUserName,
                    DelegateUserCode = DelegateUserCode,
                    CreateAtTime = DateTime.Now,
                    CreateByUserCode = CurrentEmployee.EmployeeCode,
                    CreateByUserName = CurrentEmployee.EmployeeName,
                    UpdateAtTime = DateTime.Now,
                    UpdateByUserCode = CurrentEmployee.EmployeeCode,
                    UpdateByUserName = CurrentEmployee.EmployeeName,
                    FinishedTime = DateTime.Now
                };

                if (bfApproval.AddApprovalRecord(appRecord))
                {
                    ViewState["IsSubmit"] = true;
                    wf_WorkFlowInstance.UpdateStatus(workFlowInstance.WfInstanceId, "1", nodeID.Value, nodeName.Value, int.Parse(taskID.Value), null, CurrentEmployee);

                    ScriptManager.RegisterClientScriptBlock(this, typeof(string), "1", "alert('审批成功'); window.opener.location.href=window.opener.location.href; ", true);
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", " window.opener=null; window.open('', '_self', '');window.close();", true);
                }
            }
        }
    }